Example #1
0
        public JsonResult PostShopCoupons(long id)
        {
            var shop = ShopApplication.GetShopBasicInfo(id);

            if (shop != null && (shop.ShopStatus == Entities.ShopInfo.ShopAuditStatus.Freeze || shop.ShopStatus == Entities.ShopInfo.ShopAuditStatus.HasExpired))
            {
                return(Json(new List <ShopCouponsListModel>()));
            }
            var datalist = _iCouponService.GetTopCoupon(id);
            var data     = datalist.Select(d => new ShopCouponsListModel
            {
                Id          = d.Id,
                CreateTime  = d.CreateTime,
                ShopId      = d.ShopId,
                ShopName    = d.ShopName,
                Price       = d.Price,
                PerMax      = d.PerMax,
                OrderAmount = d.OrderAmount,
                Num         = d.Num,
                StartTime   = d.StartTime,
                EndTime     = d.EndTime,
                CouponName  = d.CouponName,
                ReceiveType = d.ReceiveType,
                UseArea     = d.UseArea,
                Remark      = d.Remark
            }).ToList();

            return(Json(data));
        }
Example #2
0
        public JsonResult UnFreeze(long shopBranchId)
        {
            var branch = ShopBranchApplication.GetShopBranchById(shopBranchId);

            if (branch == null)
            {
                return(Json(new { success = false, msg = "门店有误!" }));
            }
            var shop = ShopApplication.GetShopBasicInfo(branch.ShopId);

            if (shop == null || shop.ShopStatus == Entities.ShopInfo.ShopAuditStatus.Freeze)
            {
                return(Json(new { success = false, msg = "该门店所属商家已冻结或过期,解冻失败!" }));
            }
            ShopBranchApplication.UnFreeze(shopBranchId);
            return(Json(new { success = true, msg = "解冻成功!" }));
        }
Example #3
0
        public JsonResult PostCanUseShopCoupons(long id)
        {
            var shop = ShopApplication.GetShopBasicInfo(id);

            if (shop != null && (shop.ShopStatus == Entities.ShopInfo.ShopAuditStatus.Freeze || shop.ShopStatus == Entities.ShopInfo.ShopAuditStatus.HasExpired))
            {
                return(Json(new List <ShopCouponsListModel>()));
            }

            if (CurrentUser != null)
            {
                var allcoulist = _iCouponService.GetAllUserCoupon(CurrentUser.Id);
                var datalist   = allcoulist.Where(d => d.ShopId == id);
                var data       = datalist.Select(d => new ShopCouponsListModel
                {
                    Id          = d.CouponId,
                    CreateTime  = d.CreateTime,
                    ShopId      = d.ShopId,
                    ShopName    = d.ShopName,
                    Price       = d.Price,
                    PerMax      = d.PerMax,
                    OrderAmount = d.OrderAmount,
                    Num         = d.Num,
                    StartTime   = d.StartTime,
                    EndTime     = d.EndTime,
                    CouponName  = d.CouponName,
                    UseArea     = d.UseArea,
                    Remark      = d.Remark
                }).ToList();
                return(Json(data));
            }
            else
            {
                List <ShopCouponsListModel> data = new List <ShopCouponsListModel>();
                return(Json(data));
            }
        }