public JsonResult BrokerageDetailList(long accountId, DateTime?startDate, DateTime?endDate, int page, int rows) { var queryModel = new AccountQuery() { StartDate = startDate, EndDate = endDate.HasValue ? endDate.Value.AddDays(1) : endDate, AccountId = accountId, PageSize = rows, PageNo = page }; ObsoletePageModel <BrokerageModel> list = _iAccountService.GetBrokerageList(queryModel); return(Json(new { rows = list.Models, total = list.Total })); }
public ObsoletePageModel <OrderComplaintInfo> GetOrderComplaints(ComplaintQuery complaintQuery) { int total; //所有的子账号 IList <long> childIds = new List <long>(); IQueryable <OrderComplaintInfo> complaints = Context.OrderComplaintInfo.AsQueryable(); if (complaintQuery.OrderId.HasValue) { complaints = complaints.Where(item => complaintQuery.OrderId == item.OrderId); } if (complaintQuery.StartDate.HasValue) { complaints = complaints.Where(item => item.ComplaintDate >= complaintQuery.StartDate.Value); } if (complaintQuery.EndDate.HasValue) { var endDay = complaintQuery.EndDate.Value.Date.AddDays(1); complaints = complaints.Where(item => item.ComplaintDate < endDay); } if (complaintQuery.Status.HasValue) { complaints = complaints.Where(item => complaintQuery.Status == item.Status); } if (complaintQuery.ShopId.HasValue) { complaints = complaints.Where(item => complaintQuery.ShopId == item.ShopId); } if (complaintQuery.UserId.HasValue) { complaints = complaints.Where(item => item.UserId == complaintQuery.UserId); } if (!string.IsNullOrWhiteSpace(complaintQuery.ShopName)) { complaints = complaints.Where(item => item.ShopName.Contains(complaintQuery.ShopName)); } if (!string.IsNullOrWhiteSpace(complaintQuery.UserName)) { complaints = complaints.Where(item => item.UserName.Contains(complaintQuery.UserName)); } complaints = complaints.GetPage(out total, complaintQuery.PageNo, complaintQuery.PageSize); ObsoletePageModel <OrderComplaintInfo> pageModel = new ObsoletePageModel <OrderComplaintInfo>() { Models = complaints, Total = total }; return(pageModel); }
/// <summary> /// 查询预约单 /// </summary> /// <param name="query"></param> /// <returns></returns> public ObsoletePageModel <GiftOrderInfo> GetOrders(GiftsOrderQuery query) { ObsoletePageModel <GiftOrderInfo> result = new ObsoletePageModel <GiftOrderInfo>(); long sOrderId; bool IsNumber = long.TryParse(query.skey, out sOrderId); var datasql = Context.GiftOrderInfo.AsQueryable(); if (!string.IsNullOrWhiteSpace(query.skey)) { datasql = datasql.Where(d => d.ShipTo.Contains(query.skey) || (d.Id == sOrderId) || d.Himall_GiftOrderItem.Any(di => di.GiftName.Contains(query.skey))); } if (query.OrderId.HasValue) { datasql = datasql.Where(d => d.Id == query.OrderId.Value); } if (query.status.HasValue) { datasql = datasql.Where(d => d.OrderStatus == query.status.Value); } if (query.UserId.HasValue) { datasql = datasql.Where(d => d.UserId == query.UserId.Value); } var orderby = datasql.GetOrderBy(o => o.OrderByDescending(d => d.Id)); //排序 switch (query.Sort) { default: orderby = datasql.GetOrderBy(o => o.OrderByDescending(d => d.OrderDate).ThenByDescending(d => d.Id)); break; } int total = 0; datasql = datasql.GetPage(out total, query.PageNo, query.PageSize, orderby); //数据转换 result.Models = datasql; result.Total = total; return(result); }
public JsonResult AcceptCoupon(long vshopid, long couponid) { var couponService = _iCouponService; var couponInfo = couponService.GetCouponInfo(couponid); if (couponInfo.EndTime < DateTime.Now) {//已经失效 return(Json(new { status = 2, success = false, msg = "优惠券已经过期." })); } CouponRecordQuery crQuery = new CouponRecordQuery(); crQuery.CouponId = couponid; crQuery.UserId = CurrentUser.Id; ObsoletePageModel <CouponRecordInfo> pageModel = couponService.GetCouponRecordList(crQuery); if (couponInfo.PerMax != 0 && pageModel.Total >= couponInfo.PerMax) {//达到个人领取最大张数 return(Json(new { status = 3, success = false, msg = "达到个人领取最大张数,不能再领取." })); } crQuery = new CouponRecordQuery() { CouponId = couponid }; pageModel = couponService.GetCouponRecordList(crQuery); if (pageModel.Total >= couponInfo.Num) {//达到领取最大张数 return(Json(new { status = 4, success = false, msg = "此优惠券已经领完了." })); } if (couponInfo.ReceiveType == Himall.Model.CouponInfo.CouponReceiveType.IntegralExchange) { var userInte = MemberIntegralApplication.GetMemberIntegral(CurrentUser.Id); if (userInte.AvailableIntegrals < couponInfo.NeedIntegral) { //积分不足 return(Json(new { status = 5, success = false, msg = "积分不足 " + couponInfo.NeedIntegral.ToString() })); } } CouponRecordInfo couponRecordInfo = new CouponRecordInfo() { CouponId = couponid, UserId = CurrentUser.Id, UserName = CurrentUser.UserName, ShopId = couponInfo.ShopId }; couponService.AddCouponRecord(couponRecordInfo); return(Json(new { status = 0, success = true, msg = "领取成功", crid = couponRecordInfo.Id }));//执行成功 }
public ObsoletePageModel <ShopBrandApplysInfo> GetShopBrandApplys(long?shopId, int?auditStatus, int pageNo, int pageSize, string keyWords) { int total = 0; IQueryable <ShopBrandApplysInfo> brands = Context.ShopBrandApplysInfo.FindAll(); if (auditStatus.HasValue) { brands = brands.Where(item => item.AuditStatus == (int)auditStatus); } if (shopId.HasValue) { brands = brands.Where(item => item.ShopId == shopId && item.Himall_Brands.IsDeleted == false); } if (!string.IsNullOrEmpty(keyWords)) { brands = brands.Where(item => item.Himall_Shops.ShopName.Contains(keyWords)); } brands = brands.FindBy(item => true, pageNo, pageSize, out total, a => a.Id, false); //if (auditStatus != null) //{ // brands = brands.FindBy(item => item.AuditStatus == (int)auditStatus, pageNo, pageSize, out total, a => a.Id, false); //} //if (shopId != null)ww //{ // if (!string.IsNullOrEmpty(keyWords)) // { // brands = brands.FindBy(item => item.ShopId == shopId && item.Himall_Shops.ShopName.Contains(keyWords), pageNo, pageSize, out total, a => a.Id, false); // } // else // { // brands = brands.FindBy(item => item.ShopId == shopId, pageNo, pageSize, out total, a => a.Id, false); // } //} //else //{ // if (!string.IsNullOrEmpty(keyWords)) // { // brands = brands.FindBy(item => item.Himall_Shops.ShopName.Contains(keyWords), pageNo, pageSize, out total, a => a.Id, false); // } //} ObsoletePageModel <ShopBrandApplysInfo> pageModel = new ObsoletePageModel <ShopBrandApplysInfo>() { Models = brands, Total = total }; return(pageModel); }
public ObsoletePageModel <CouponInfo> GetIntegralCoupons(int page, int pageSize) { ObsoletePageModel <CouponInfo> result = new ObsoletePageModel <CouponInfo>(); DateTime CurDay = DateTime.Now; DateTime CurTime = DateTime.Now; int auditsuccess = (int)WXCardLogInfo.AuditStatusEnum.Audited; var sql = Context.CouponInfo.Where(d => d.ReceiveType == CouponInfo.CouponReceiveType.IntegralExchange && d.EndIntegralExchange >= CurTime && d.EndTime >= CurDay && d.StartTime <= CurDay && d.WXAuditStatus == auditsuccess && d.Num > 0); int total = 0; sql = sql.GetPage(out total, page, pageSize, d => d.OrderByDescending(o => o.CreateTime)); result.Models = sql; result.Total = total; return(result); }
public ObsoletePageModel <CapitalInfo> GetCapitals(CapitalQuery query) { var capital = Context.CapitalInfo.Where(e => true); if (query.memberId.HasValue) { capital = Context.CapitalInfo.Where(e => e.MemId == query.memberId); } int total = 0; var page = capital.GetPage(out total, query.PageNo, query.PageSize, o => o.OrderByDescending(e => e.Id)); ObsoletePageModel <CapitalInfo> result = new ObsoletePageModel <CapitalInfo> { Models = page, Total = total }; return(result); }
public JsonResult List(int page, int rows) { IMemberCapitalService service = this._iMemberCapitalService; CapitalDetailQuery query = new CapitalDetailQuery { memberId = base.CurrentUser.Id, PageSize = rows, PageNo = page }; ObsoletePageModel <CapitalDetailInfo> capitalDetails = service.GetCapitalDetails(query); IEnumerable <CapitalDetailModel> enumerable = from e in capitalDetails.Models.ToList <CapitalDetailInfo>() select new CapitalDetailModel { Id = e.Id, Amount = e.Amount, CapitalID = e.CapitalID, CreateTime = e.CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), SourceData = e.SourceData, SourceType = e.SourceType, Remark = e.SourceType.ToDescription(), PayWay = e.Remark }; return(base.Json(new { model = enumerable, total = capitalDetails.Total })); }
public ObsoletePageModel <InviteRecordInfo> GetInviteList(InviteRecordQuery query) { int total = 0; ObsoletePageModel <InviteRecordInfo> result = new ObsoletePageModel <InviteRecordInfo>(); var datasql = Context.InviteRecordInfo.AsQueryable(); if (!string.IsNullOrEmpty(query.userName)) { datasql = datasql.Where(d => d.UserName.Equals(query.userName)); } datasql = datasql.GetPage(out total, query.PageNo, query.PageSize, d => d.OrderByDescending(a => a.Id)); //数据转换 result.Models = datasql; result.Total = total; return(result); }
public ActionResult Home(string catename = "") { Func <SelectListItem, bool> predicate = null; List <SelectListItem> source = new List <SelectListItem>(); string[] serviceCategories = this._iLimitTimeBuyService.GetServiceCategories(); foreach (string str in serviceCategories) { SelectListItem item = new SelectListItem { Selected = false, Text = str, Value = str }; source.Add(item); } if (!string.IsNullOrWhiteSpace(catename)) { if (predicate == null) { predicate = c => c.Text.Equals(catename); } SelectListItem item2 = source.FirstOrDefault <SelectListItem>(predicate); if (item2 != null) { item2.Selected = true; } } FlashSaleConfigModel config = this._iLimitTimeBuyService.GetConfig(); ((dynamic)base.ViewBag).Preheat = config.Preheat; ((dynamic)base.ViewBag).Cate = source; FlashSaleQuery query = new FlashSaleQuery { CategoryName = catename, OrderKey = 5, IsPreheat = true, PageNo = 1, PageSize = 10, AuditStatus = FlashSaleInfo.FlashSaleStatus.Ongoing, CheckProductStatus = true }; ObsoletePageModel <FlashSaleInfo> all = this._iLimitTimeBuyService.GetAll(query); return(base.View(all)); }
public ObsoletePageModel <UserOrderCommentModel> GetOrderComment(OrderCommentQuery query) { var model = Context.OrderCommentInfo.Where(a => a.UserId == query.UserId); int total = 0; model = model.GetPage(out total, query.PageNo, query.PageSize, d => d.OrderByDescending(item => item.Id)); var OrderCommentModel = model.Select(a => new UserOrderCommentModel { CommentTime = a.CommentDate, OrderId = a.OrderId }).ToList(); ObsoletePageModel <UserOrderCommentModel> pageModel = new ObsoletePageModel <UserOrderCommentModel>() { Models = OrderCommentModel.AsQueryable(), Total = total }; return(pageModel); }
public ObsoletePageModel <BonusReceiveInfo> GetDetail(long bonusId, int pageIndex = 1, int pageSize = 15) { if (pageIndex <= 0) { pageIndex = 1; } int total = 0; var bonusReceiveContext = Context.BonusReceiveInfo.Where(p => p.Himall_Bonus.Id == bonusId); IQueryable <BonusReceiveInfo> datas = bonusReceiveContext.GetPage(out total, p => p.OrderByDescending(o => o.ReceiveTime), pageIndex, pageSize); ObsoletePageModel <BonusReceiveInfo> pageModel = new ObsoletePageModel <BonusReceiveInfo>() { Models = datas, Total = total }; return(pageModel); }
public static ObsoletePageModel <WeiActivityWinModel> GetActivityWin(string text, long id, int pageIndex, int pageSize) { ObsoletePageModel <WeiActivityWinInfo> weiInfo = _iWeiActivityWinService.Get(text, id, pageIndex, pageSize); var datas = weiInfo.Models.ToList().Select(m => new WeiActivityWinModel() { userName = MemberApplication.GetMember(m.UserId).UserName, awardName = m.AwardName, addDate = m.AddDate }).ToList(); ObsoletePageModel <WeiActivityWinModel> t = new ObsoletePageModel <WeiActivityWinModel>(); t.Models = datas.AsQueryable(); t.Total = weiInfo.Total; return(t); }
private void InitialPhotoSpaceModel(PhotoSpaceAjaxModel model, ObsoletePageModel <PhotoSpaceInfo> photo, int pageNo = 1) { var list = new List <photoContent>(); int pageCount = TemplatePageHelper.GetPageCount(photo.Total, 24); model.page = TemplatePageHelper.GetPageHtml(pageCount, pageNo); foreach (var item in photo.Models) { list.Add(new photoContent { file = Core.HimallIO.GetRomoteImagePath(item.PhotoPath), id = item.Id.ToString(), name = item.PhotoName }); } model.data = list; }
public ObsoletePageModel <CouponRecordInfo> GetCouponRecordList(CouponRecordQuery query) { int total = 0; var date = DateTime.Now; IQueryable <CouponRecordInfo> coupons = Context.CouponRecordInfo.AsQueryable(); if (query.CouponId.HasValue) { coupons = coupons.Where(d => d.CouponId == query.CouponId); } if (query.UserId.HasValue) { coupons = coupons.Where(d => d.UserId == query.UserId.Value); } if (query.ShopId.HasValue) { coupons = coupons.Where(d => d.ShopId == query.ShopId.Value); } if (!string.IsNullOrWhiteSpace(query.UserName)) { coupons = coupons.Where(d => d.UserName.Contains(query.UserName)); } switch (query.Status) { case 0: coupons = coupons.Where(item => item.CounponStatus == CouponRecordInfo.CounponStatuses.Unuse && item.Himall_Coupon.EndTime > date); break; case 1: coupons = coupons.Where(item => item.CounponStatus == CouponRecordInfo.CounponStatuses.Used); break; case 2: coupons = coupons.Where(item => item.CounponStatus == CouponRecordInfo.CounponStatuses.Unuse && item.Himall_Coupon.EndTime <= date); break; } coupons = coupons.GetPage(out total, query.PageNo, query.PageSize); ObsoletePageModel <CouponRecordInfo> pageModel = new ObsoletePageModel <CouponRecordInfo>() { Models = coupons, Total = total }; return(pageModel); }
public ObsoletePageModel <CollocationInfo> GetCollocationList(CollocationQuery query) { int total = 0; var coll = Context.CollocationInfo.Join(Context.ShopInfo, a => a.ShopId, b => b.Id, (a, b) => new CollocationModel { Id = a.Id, CreateTime = a.CreateTime.Value, StartTime = a.StartTime, EndTime = a.EndTime, Title = a.Title, ShortDesc = a.ShortDesc, ShopName = b.ShopName, ShopId = a.ShopId, ProductId = 0, }); coll = coll.Join(Context.CollocationPoruductInfo.Where(t => t.IsMain == true), a => a.Id, b => b.ColloId, (a, b) => new CollocationModel { Id = a.Id, CreateTime = a.CreateTime.Value, StartTime = a.StartTime, EndTime = a.EndTime, Title = a.Title, ShortDesc = a.ShortDesc, ShopName = a.ShopName, ShopId = a.ShopId, ProductId = b.ProductId } ); if (!string.IsNullOrEmpty(query.Title)) { coll = coll.Where(d => d.Title.Contains(query.Title)); } if (query.ShopId.HasValue) { coll = coll.Where(d => d.ShopId == query.ShopId.Value); } coll = coll.GetPage(out total, query.PageNo, query.PageSize, d => d.OrderByDescending(item => item.CreateTime)); ObsoletePageModel <CollocationInfo> pageModel = new ObsoletePageModel <CollocationInfo>() { Models = coll, Total = total }; return(pageModel); }
public ObsoletePageModel <OrderCommentInfo> GetOrderComments(OrderCommentQuery query) { IQueryable <OrderCommentInfo> orderComments = Context.OrderCommentInfo.AsQueryable(); #region 条件组合 if (query.OrderId.HasValue) { orderComments = orderComments.Where(item => query.OrderId == item.OrderId); } if (query.StartDate.HasValue) { orderComments = orderComments.Where(item => item.CommentDate >= query.StartDate.Value); } if (query.EndDate.HasValue) { var end = query.EndDate.Value.Date.AddDays(1); orderComments = orderComments.Where(item => item.CommentDate < end); } if (query.ShopId.HasValue) { orderComments = orderComments.Where(item => query.ShopId == item.ShopId); } if (query.UserId.HasValue) { orderComments = orderComments.Where(item => query.UserId == item.UserId); } if (!string.IsNullOrWhiteSpace(query.ShopName)) { orderComments = orderComments.Where(item => item.ShopName.Contains(query.ShopName)); } if (!string.IsNullOrWhiteSpace(query.UserName)) { orderComments = orderComments.Where(item => item.UserName.Contains(query.UserName)); } #endregion int total; orderComments = orderComments.GetPage(out total, query.PageNo, query.PageSize); ObsoletePageModel <OrderCommentInfo> pageModel = new ObsoletePageModel <OrderCommentInfo>() { Models = orderComments, Total = total }; return(pageModel); }
public JsonResult GetProductList(string skey, int rows, int page, string categoryPatha, string categoryPathb, string categoryPathc, long categoryId = 0) { //查询条件 ProductBrokerageQuery query = new ProductBrokerageQuery(); query.skey = skey; query.PageSize = rows; query.PageNo = page; query.ProductBrokerageState = ProductBrokerageInfo.ProductBrokerageStatus.Normal; query.ShopId = curshopid; if (categoryId != 0) { query.CategoryId = categoryId; } query.CategoryPathA = categoryPatha; query.CategoryPathB = categoryPathb; query.CategoryPathC = categoryPathc; ObsoletePageModel <ProductBrokerageInfo> datasql = _iDistributionService.GetDistributionProducts(query); List <DistributionProductListModel> datalist = new List <DistributionProductListModel>(); if (datasql.Models != null) { datalist = datasql.Models.Select(d => new DistributionProductListModel { BrokerageId = d.Id, ProductId = d.ProductId, ProductName = d.Product.ProductName, //Image = d.Product.GetImage(ProductInfo.ImageSize.Size_50), CategoryId = d.Product.CategoryId, CategoryName = d.CategoryName, DistributorRate = d.rate, ProductBrokerageState = d.Status, ProductSaleState = d.Product.SaleStatus, SellPrice = d.Product.MinSalePrice, ShowProductBrokerageState = d.Status.ToDescription(), ShowProductSaleState = d.Product.ShowProductState }).ToList(); } var result = new { rows = datalist, total = datasql.Total }; return(Json(result)); }
public ObsoletePageModel <BrokerageModel> GetBrokerageList(AccountQuery query) { var accountDetails = Context.AccountDetailInfo.Where(a => a.AccountId == query.AccountId && a.OrderType == AccountDetailInfo.EnumOrderType.FinishedOrder); if (query.StartDate.HasValue) { accountDetails = accountDetails.Where(item => item.Date >= query.StartDate); } if (query.EndDate.HasValue) { accountDetails = accountDetails.Where(item => item.Date < query.EndDate); } var model = Context.BrokerageIncomeInfo.Join(accountDetails, a => a.OrderId, b => b.OrderId, (a, b) => new { a.OrderId, a.Id, a.ProductName, a.ProductID, a.TotalPrice, a.UserId, a.Brokerage, b.Date }); var list = model.Join(Context.UserMemberInfo, a => a.UserId, b => b.Id, (a, b) => new BrokerageModel { OrderId = a.OrderId.Value, ProductName = a.ProductName, ProductId = a.ProductID, RealTotal = a.TotalPrice.Value, UserId = a.UserId, Brokerage = a.Brokerage, SettlementTime = a.Date, Id = a.Id, UserName = b.UserName }); var total = 0; list = list.GetPage(out total, d => d.OrderBy(item => item.SettlementTime).ThenBy(item => item.Id), query.PageNo, query.PageSize); ObsoletePageModel <BrokerageModel> pageModel = new ObsoletePageModel <BrokerageModel>() { Models = list, Total = total }; return(pageModel); }
public ObsoletePageModel <CouponInfo> GetCouponList(CouponQuery query) { if (query.ShopId.HasValue) { if (query.ShopId <= 0) { throw new HimallException("ShopId不能识别"); } } int total = 0; int auditsuccess = (int)WXCardLogInfo.AuditStatusEnum.Audited; IQueryable <CouponInfo> coupon = Context.CouponInfo.AsQueryable(); if (query.ShopId.HasValue) { coupon = coupon.Where(d => d.ShopId == query.ShopId); } if (query.IsShowAll != true) { coupon = coupon.Where(d => d.WXAuditStatus == auditsuccess); } if (query.ShowPlatform.HasValue) { coupon = coupon.Where(d => d.Himall_CouponSetting.Any(s => s.PlatForm == query.ShowPlatform.Value)); } if (query.IsOnlyShowNormal == true) { DateTime curMindate = DateTime.Now.Date; DateTime curMaxdate = curMindate.AddDays(1).Date; coupon = coupon.Where(d => d.EndTime >= curMaxdate && d.StartTime <= curMindate); } if (!string.IsNullOrWhiteSpace(query.CouponName)) { coupon = coupon.Where(d => d.CouponName.Contains(query.CouponName)); } coupon = coupon.GetPage(out total, d => d.OrderByDescending(o => o.EndTime), query.PageNo, query.PageSize); ObsoletePageModel <CouponInfo> pageModel = new ObsoletePageModel <CouponInfo>() { Models = coupon, Total = total }; return(pageModel); }
public ObsoletePageModel <BonusInfo> Get(int type, int state = 1, string name = "", int pageIndex = 1, int pageSize = 20) { IQueryable <BonusInfo> query = Context.BonusInfo; if (type > 0) { query = Context.BonusInfo.Where(p => (int)p.Type == type); } if (!string.IsNullOrEmpty(name)) { query = query.Where(p => p.Name.Contains(name)); } if (pageIndex <= 0) { pageIndex = 1; } if (state == 1) { query = query.Where(p => p.EndTime > DateTime.Now && !p.IsInvalid); } else if (state == 2) { query = query.Where(p => p.IsInvalid || p.EndTime < DateTime.Now); } int total = 0; IQueryable <BonusInfo> datas = query.GetPage(out total, p => p.OrderByDescending(o => o.StartTime), pageIndex, pageSize); foreach (BonusInfo item in datas) { item.TypeStr = item.Type.ToDescription(); item.StartTimeStr = item.StartTime.ToString("yyyy-MM-dd"); item.EndTimeStr = item.EndTime.ToString("yyyy-MM-dd"); } ObsoletePageModel <BonusInfo> pageModel = new ObsoletePageModel <BonusInfo>() { Models = datas, Total = total }; return(pageModel); }
public ActionResult GetData(int index, int size, string cname) { FlashSaleQuery query = new FlashSaleQuery { ItemName = cname, IsPreheat = true, PageNo = index, PageSize = size, AuditStatus = FlashSaleInfo.FlashSaleStatus.Ongoing, CheckProductStatus = true }; ObsoletePageModel <FlashSaleInfo> all = this._iLimitTimeBuyService.GetAll(query); List <FlashSaleModel> list = new List <FlashSaleModel>(); foreach (FlashSaleInfo info in all.Models.ToList <FlashSaleInfo>()) { FlashSaleModel item = new FlashSaleModel { Id = info.Id, Title = info.Title, ShopId = info.ShopId, ProductId = info.ProductId, Status = info.Status, ProductName = info.Himall_Products.ProductName, ProductImg = HimallIO.GetProductSizeImage(info.Himall_Products.RelativePath, 1, 0), MarketPrice = info.Himall_Products.MarketPrice, BeginDate = info.BeginDate.ToString("yyyy-MM-dd HH:mm"), EndDate = info.EndDate.ToString("yyyy-MM-dd HH:mm"), LimitCountOfThePeople = info.LimitCountOfThePeople, SaleCount = info.SaleCount, CategoryName = info.CategoryName, MinPrice = info.MinPrice }; list.Add(item); } DataGridModel <FlashSaleModel> data = new DataGridModel <FlashSaleModel> { total = all.Total, rows = list }; return(base.Json(data)); }
public JsonResult List(int?status, int page, int rows, string shopName, string title) { if (status == null) { status = 0; } ObsoletePageModel <FlashSaleInfo> result = _iLimitTimeBuyService.GetAll((int)status, shopName, title, page, rows); IEnumerable <FlashSaleModel> market = result.Models.ToArray().Select(item => { var m = new FlashSaleModel(); m.Id = item.Id; m.Title = item.Title; m.BeginDate = item.BeginDate.ToString("yyyy-MM-dd"); m.EndDate = item.EndDate.ToString("yyyy-MM-dd"); m.ShopName = item.Himall_Shops.ShopName; m.ProductName = item.Himall_Products.ProductName; m.ProductId = item.ProductId; //StatusStr = item.EndDate < DateTime.Now ?FlashSaleInfo.FlashSaleStatus.Ended.ToDescription() : item.Status.ToDescription() , m.StatusStr = item.Status.ToDescription(); if (item.Status != FlashSaleInfo.FlashSaleStatus.WaitForAuditing && item.Status != FlashSaleInfo.FlashSaleStatus.AuditFailed && item.BeginDate > DateTime.Now && item.EndDate < DateTime.Now) { m.StatusStr = "进行中"; } else if (item.Status != FlashSaleInfo.FlashSaleStatus.WaitForAuditing && item.Status != FlashSaleInfo.FlashSaleStatus.AuditFailed && item.BeginDate > DateTime.Now) { m.StatusStr = "未开始"; } m.SaleCount = item.SaleCount; return(m); }); DataGridModel <FlashSaleModel> dataGrid = new DataGridModel <FlashSaleModel>() { rows = market, total = result.Total }; return(Json(dataGrid)); }
public JsonResult CashDepositDetail(long cashDepositId, int pageNo = 1, int pageSize = 10) { CashDepositDetailQuery query = new CashDepositDetailQuery() { CashDepositId = cashDepositId, PageNo = pageNo, PageSize = pageSize }; ObsoletePageModel <CashDepositDetailInfo> cashDepositDetails = _iCashDepositsService.GetCashDepositDetails(query); var cashDepositDetailModel = cashDepositDetails.Models.ToArray().Select(item => new { Id = item.Id, Date = item.AddDate.ToString("yyyy-MM-dd HH:mm"), Balance = item.Balance, Operator = item.Operator, Description = item.Description }); return(Json(new { rows = cashDepositDetailModel, total = cashDepositDetails.Total })); }
/// <summary> /// 取积分优惠券 /// </summary> /// <param name="page"></param> /// <param name="pagesize"></param> /// <returns></returns> public QueryPageModel <CouponGetIntegralCouponModel> GetIntegralCoupon(int page = 1, int pagesize = 10) { var _iCouponService = ServiceProvider.Instance <ICouponService> .Create; IVShopService _iVShopService = ServiceProvider.Instance <IVShopService> .Create; ObsoletePageModel <CouponInfo> coupons = _iCouponService.GetIntegralCoupons(page, pagesize); Mapper.CreateMap <CouponInfo, CouponGetIntegralCouponModel>(); QueryPageModel <CouponGetIntegralCouponModel> result = new QueryPageModel <CouponGetIntegralCouponModel>(); result.Total = coupons.Total; if (result.Total > 0) { var datalist = coupons.Models.ToList(); var objlist = new List <CouponGetIntegralCouponModel>(); foreach (var item in datalist) { var tmp = Mapper.Map <CouponGetIntegralCouponModel>(item); var vshopobj = _iVShopService.GetVShopByShopId(tmp.ShopId); if (vshopobj != null) { tmp.VShopId = vshopobj.Id; //优惠价封面为空时,取微店Logo,微店Logo为空时,取商城微信Logo if (string.IsNullOrWhiteSpace(tmp.ShowIntegralCover)) { if (!string.IsNullOrWhiteSpace(vshopobj.WXLogo)) { tmp.ShowIntegralCover = Core.HimallIO.GetRomoteImagePath(vshopobj.WXLogo); } else { var siteset = SiteSettingApplication.GetSiteSettings(); tmp.ShowIntegralCover = Core.HimallIO.GetRomoteImagePath(siteset.WXLogo); } } } objlist.Add(tmp); } result.Models = objlist.ToList(); } return(result); }
public ObsoletePageModel <TopicInfo> GetTopics(IServices.QueryModel.TopicQuery topicQuery) { var topic = new ObsoletePageModel <TopicInfo>(); int total; var topics = Context.TopicInfo.Where(item => item.PlatForm == topicQuery.PlatformType); #region 条件组合 if (topicQuery.ShopId > 0) { topics = topics.Where(item => item.ShopId == topicQuery.ShopId); } else { topics = topics.Where(item => item.ShopId == 0); } if (topicQuery.IsRecommend.HasValue) { topics = topics.Where(item => item.IsRecommend == topicQuery.IsRecommend.Value); } if (!string.IsNullOrWhiteSpace(topicQuery.Name)) { topicQuery.Name = topicQuery.Name.Trim(); topics = topics.Where(item => item.Name.Contains(topicQuery.Name)); } if (!string.IsNullOrWhiteSpace(topicQuery.Tags)) { topicQuery.Tags = topicQuery.Tags.Trim(); topics = topics.Where(item => item.Tags.Contains(topicQuery.Tags)); } #endregion var orderBy = topics.GetOrderBy(d => d.OrderByDescending(o => o.Id)); if (topicQuery.IsAsc) { orderBy = topics.GetOrderBy(d => d.OrderBy(o => o.Id)); } topic.Models = topics.GetPage(out total, topicQuery.PageNo, topicQuery.PageSize, orderBy); topic.Total = total; return(topic); }
public JsonResult List(string shopName, int page, int rows) { var queryModel = new MarketBoughtQuery() { PageSize = rows, PageNo = page, ShopName = shopName, MarketType = MarketType.Collocation }; ObsoletePageModel <MarketServiceRecordInfo> marketEntities = _iMarketService.GetBoughtShopList(queryModel); var market = marketEntities.Models.OrderByDescending(m => m.MarketServiceId).ThenByDescending(m => m.EndTime).ToArray().Select(item => new { Id = item.Id, StartDate = item.StartTime.ToString("yyyy-MM-dd"), EndDate = item.EndTime.ToString("yyyy-MM-dd"), ShopName = item.ActiveMarketServiceInfo.ShopName }); return(Json(new { rows = market, total = marketEntities.Total })); }
public JsonResult ShopList(string skey, int page, long sort = 0) { //查询条件 DistributionShopQuery query = new DistributionShopQuery(); query.skey = skey; query.PageSize = 5; query.PageNo = page; query.Sort = DistributionShopQuery.EnumShopSort.Default; switch (sort) { case 2: query.Sort = DistributionShopQuery.EnumShopSort.ProductNum; break; } ObsoletePageModel <DistributionShopModel> datasql = _iDistributionService.GetShopDistributionList(query); List <DistributionShopModel> datalist = datasql.Models.ToList(); return(Json(datalist)); }
/// <summary> /// 获取所有的诊疗项目 /// </summary> /// <param name="query"></param> /// <returns></returns> public ObsoletePageModel <ProductInfo> GetWXSmallProducts(int page, int rows) { ObsoletePageModel <ProductInfo> model = new ObsoletePageModel <ProductInfo>(); StringBuilder sb = new StringBuilder(); sb.Append(" select * from Himall_Products pt left join Himall_WXSmallChoiceProducts ps on pt.Id=ps.ProductId "); sb.Append(" where pt.IsDeleted=FALSE and ps.ProductId>0 "); sb.Append(" order by ps.ProductId "); var start = (page - 1) * rows; var end = page * rows; sb.Append(" limit " + start + "," + rows); var list = Context.Database.SqlQuery <ProductInfo>(sb.ToString()).ToList(); model.Models = list.AsQueryable(); var count = 0; count = Context.WXSmallChoiceProductsInfo.Count(); model.Total = count; return(model); }
public ObsoletePageModel <VShopInfo> GetVShopByParamete(VshopQuery vshopQuery) { int total = 0; var vshops = Context.VShopInfo.AsQueryable(); if (vshopQuery.VshopType.HasValue) { if (vshopQuery.VshopType != 0) { vshops = from a in Context.VShopInfo where (from b in a.VShopExtendInfo where b.Type == vshopQuery.VshopType select b.VShopId).Contains(a.Id) select a; } else { vshops = from a in Context.VShopInfo where a.VShopExtendInfo.Count() == 0 select a; } } if (!string.IsNullOrEmpty(vshopQuery.Name)) { vshops = vshops.Where(a => a.Name.Contains(vshopQuery.Name)); } if (vshopQuery.ExcepetVshopId.HasValue && vshopQuery.ExcepetVshopId.Value != 0) { vshops = vshops.Where(a => a.Id != vshopQuery.ExcepetVshopId.Value); } vshops = vshops.Where(e => e.State == VShopInfo.VshopStates.Normal || e.State == VShopInfo.VshopStates.Close); total = vshops.Count(); ObsoletePageModel <VShopInfo> result = new ObsoletePageModel <VShopInfo>(); result.Models = vshops.OrderBy(a => a.CreateTime).Skip((vshopQuery.PageNo - 1) * vshopQuery.PageSize).Take(vshopQuery.PageSize).AsQueryable(); result.Total = total; return(result); }