示例#1
0
        public APIResult HasTakeOut([FromBody] HasTakeOutArgsModels args)
        {
            if (!args.ShopId.HasValue)
            {
                throw new Exception("ShopID不能为空");
            }
            bool result = false;

            var toInfo = db.Query <ShopTakeOutInfo>()
                         .Where(m => !m.IsDel)
                         .Where(m => m.ShopId == args.ShopId.Value)
                         .FirstOrDefault();

            if (toInfo != null)
            {
                result = true;
            }

            return(Success(result));
        }
示例#2
0
        public APIResult GetTakeOutInfo([FromBody] HasTakeOutArgsModels args)
        {
            if (!args.ShopId.HasValue)
            {
                throw new Exception("shopId为空");
            }

            var model = db.Query <ShopTakeOutInfo>()
                        .Where(m => !m.IsDel)
                        .Where(m => m.ShopId == args.ShopId.Value)
                        .FirstOrDefault();

            return(Success(new GetTakeOutInfoModel()
            {
                IsUseTakeOut = model.IsUseTakeOut,
                BoxFee = model.BoxFee / 100d,
                DeliveryFee = model.DeliveryFee / 100d,
                IsOpen = model.IsOpen,
                MinAmount = model.MinAmount / 100d
            }));
        }