Beispiel #1
0
        public async Task <PagedResult <AreaOfferDto> > SearchPAreaOffersAsync(AreaOfferFilter filters)
        {
            if (filters == null)//110000
            {
                return(new PagedResult <AreaOfferDto>());
            }
            var parent = await FindAllByParentId(filters.AreaId);

            var query = _context.AreaOffers
                        .WhereIf(filters.AreaId.IsNotBlank(), x => x.AreaId == filters.AreaId || x.AreaId.StartsWith(GetParentAreaId(filters.AreaId)));

            return(await query.OrderByDescending(x => x.CreateDateTime)
                   .Select(item => new AreaOfferDto
            {
                Id = item.Id,
                AreaId = item.AreaId,
                AreaName = parent == null?string.Empty: (parent.FirstOrDefault(c => c.id == item.AreaId) == null?string.Empty: parent.FirstOrDefault(c => c.id == item.AreaId).name),
                //AreaName = parent?.FirstOrDefault(c=>c.id==item.AreaId)?.name??string.Empty,
                A1OfferPrice = item.A1OfferPrice,
                A2OfferPrice = item.A2OfferPrice,
                A3OfferPrice = item.A3OfferPrice,
                B1OfferPrice = item.B1OfferPrice,
                B2OfferPrice = item.B2OfferPrice,
                C1OfferPrice = item.C1OfferPrice,
                C2OfferPrice = item.C2OfferPrice,
                C3OfferPrice = item.C3OfferPrice,
                C4OfferPrice = item.C4OfferPrice,
                DOfferPrice = item.DOfferPrice,
                EOfferPrice = item.EOfferPrice,
                FOfferPrice = item.FOfferPrice,
                MOfferPrice = item.MOfferPrice,
                NOfferPrice = item.NOfferPrice,
                POfferPrice = item.POfferPrice,
                CreateDateTime = item.CreateDateTime
            }).PagingAsync(filters.page, filters.rows));
        }
Beispiel #2
0
        /// <summary>
        /// 获取票价值
        /// </summary>
        //[HttpPost, IgnoreRightFilter]
        public async Task <ActionResult> AreaOfferPriceList(AreaOfferFilter model)
        {
            var pages = await _areaService.SearchPAreaOffersAsync(model);

            return(Json(pages));
        }