多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
文件路径:shop/controllers/Seller/Promotion/DiscountCtl.php 一、活动列表【方法:index();】 * 控制器:shop/controllers/Seller/Promotion/DiscountCtl.php ->index() * 模型:shop/models/Discount/QuotaModel.php shop/models/Discount/BaseModel.php * 视图:shop/views/default/Seller/Promotion/DiscountCtl/index.php 1.套餐过期时间及备注 ~~~ if (!$this->self_support_flag) //普通店铺 { $com_flag = $this->combo_flag; if ($this->combo_flag)//套餐可用 { $combo_row = $this->discountQuotaModel->getDiscountQuotaByShopID(Perm::$shopId); } } //店铺下的加价购活动列表 $data = $this->discountBaseModel->getDiscountActList($cond_row, array('discount_id' => 'DESC'), $page, $rows); ~~~ 2.活动状态 模型:shop/models/Discount/BaseModel.php 参数:increase_state(0.全部1.正常 2.已结束 3.管理员关闭) ~~~ const NORMAL = 1;//正常 const END = 2;//结束 const CANCEL = 3;//管理员关闭 ~~~ 3.操作 * 编辑(添加活动) 方法:shop/controllers/Seller/Promotion/DiscountCtl.php ->addDiscount() 视图:shop/views/default/Seller/Promotion/DiscountCtl/add.php 模型: shop/models/Discount/BaseModel.php 提交时表单验证:`$('#form').validator({})` 提交成功写入数据:`$discount_id = $this->discountBaseModel->addDiscountActivity($field_row, true);` * 管理 视图:shop/views/default/Seller/Promotion/DiscountCtl/manage.php 添加商品:通过AJAX获取可以参加限时折扣的商品,已经参加团购活动的商品除外 方法:getShopGoods(); ~~~ $('.btn_search_goods').on('click', function() { var url = SITE_URL + '?ctl=Seller_Promotion_Discount&met=getShopGoods&typ=e'; var key = $('#search_goods_name').val(); url = key ? url + "&goods_name=" + key : url; $('.search-goods-list-bd').load(url); }); ~~~ * 删除限时折扣 控制器:shop/controllers/Seller/Promotion/DiscountCtl.php ->removeDiscountAct() 模型:shop/models/Discount/BaseModel.php 视图:shop/views/default/Seller/Promotion/DiscountCtl/index.php 二、添加活动 1.活动开始时间:不得小于当前时间,且小于套餐结束时间 2.活动结束时间:不得小于当前时间,且小于套餐结束时间 3.提交 新增活动提交时进行表单验证:`$('#form').validator({})` * 方法:shop/controllers/Seller/Promotion/DiscountCtl.php ->addDiscount() * 视图:shop/views/default/Seller/Promotion/DiscountCtl/add.php * 模型: shop/models/Discount/BaseModel.php 三、套餐管理【方法:combo();】 1、套餐活动列表 * 控制器:shop/controllers/Seller/Promotion/DiscountCtl.php ->combo() * 模型:shop/models/Shop/CostModel.php * 视图:shop/views/default/Seller/Promotion/DiscountCtl/combo.php 2.、购买套餐 * 视图:shop/views/default/Seller/Promotion/DiscountCtl/combo.php * 控制器:shop/controllers/Seller/Promotion/DiscountCtl.php ->addCombo() * 模型:shop/models/Discount/ComboModel.php (1)购买套餐时提交时进行表单验证:`$('#form').validator({})` (2)在店铺的账期结算中扣除相关费用并且在paycenter中添加交易记录 参数:店铺id,根据店铺id号获取店铺套餐详情 1、原套餐已经过期,更新套餐开始时间和结束时间 2、原套餐尚未过期,只需更新结束时间 3、如果没有套餐详情,则套餐购买