企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
文件路径:shop/controllers/Seller/Promotion/IncreaseCtl.php 一、活动列表【方法:index();】 1.套餐过期时间及备注 ~~~ if (!$this->self_support_flag) //普通店铺 { $com_flag = $this->combo_flag; if ($this->combo_flag)//套餐可用 { $combo_row = $this->increaseComboModel->getComboInfo(Perm::$shopId); } } //店铺下的加价购活动列表 $data = $this->increaseBaseModel->getIncreaseActList($cond_row, array('increase_id' => 'ASC'), $page, $rows); ~~~ 2.活动状态 模型:shop/models/Increase/BaseModel.php 参数:increase_state(0.全部1.正常 2.已结束 3.管理员关闭) ~~~ const NORMAL = 1;//正常 const END = 2;//结束 const CANCEL = 3;//管理员关闭 ~~~ 3.操作 3.1编辑 参数:id、edit 根据URL获取id、edit判断活动列表和活动内容编辑 视图:views/default/Seller/Promotion/IncreaseCtl/edit.php 编辑活动内容后提交表单验证:$('#form').validator({}) 方法:editIncrease(); ~~~ if (request_string('op') == 'edit' && request_int('id')) { //编辑活动内容 $increase_id = request_int('id'); $check_row = $this->increaseBaseModel->getIncreaseActItem($increase_id); if ($check_row['shop_id'] == Perm::$shopId) { $data = $this->increaseBaseModel->getIncreaseActDetail($increase_id); } else { location_to('index.php?ctl=Seller_Promotion_Increase&met=index&typ=e'); } //视图:views/default/Seller/Promotion/IncreaseCtl/edit.php //编辑活动内容后提交表单验证:$('#form').validator({}) //方法:editIncrease(); $this->view->setMet('edit'); } ~~~ 3.1.1添加活动商品 通过AJAX获得店铺所有商品 ~~~ $('.btn-ctl-select-goods').click(function(){ var increase_id = $(this).attr('data-increase-id'); var url = SITE_URL + '?ctl=Seller_Promotion_Increase&met=getShopGoods&typ=e&op=edit'; $('#cou-sku-options').load(url,{id:increase_id}); }); ~~~ 3.1.2添加活动规则 选择换购商品: ~~~ $('body').on('click','[btn-choose-rule-ex-goods]', function() { var id = $(this).attr('btn-choose-rule-ex-goods'); $("[btn-choose-rule-ex-goods='"+id+"']").hide(); $("[data-cou-level-sku-close-button='"+id+"']").show(); getShopGoodsSku(id); }); ~~~ URL异步请求获取店铺可以参加换购的商品:方法:getShopGoodsSku(); 视图:shop/views/default/Seller/Promotion/IncreaseCtl/getShopGoodsSku.php 4.删除加价购 * 控制器:shop/controllers/Seller/Promotion/IncreaseCtl.php ->removeIncreaseAct() * 模型:shop/models/Increase/BaseModel.php * 视图:shop/views/default/Seller/Promotion/IncreaseCtl/index.php 二、添加活动 1.活动开始时间:不得小于当前时间,且小于套餐结束时间 2.活动结束时间:不得小于当前时间,且小于套餐结束时间 3.提交 新增活动提交时进行表单验证:`$('#form').validator({})` * 控制器:shop/controllers/Seller/Promotion/IncreaseCtl.php ->addIncrease() * 模型:shop/models/Increase/BaseModel.php * 视图:shop/views/default/Seller/Promotion/IncreaseCtl/add.php 三、套餐管理【方法:combo();】 1、套餐活动列表 * 控制器:shop/controllers/Seller/Promotion/IncreaseCtl.php ->combo() * 模型:shop/models/Shop/CostModel.php * 视图:shop/views/default/Seller/Promotion/IncreaseCtl/combo.php 套餐活动列表 `$data = $this->shopCostModel->listByWhere($cond_row,$order_row,$page, $rows);` 2.、购买套餐 * 视图:shop/views/default/Seller/Promotion/IncreaseCtl/combo.php * 控制器:shop/controllers/Seller/Promotion/IncreaseCtl.php ->addCombo() * 模型:shop/models/Increase/ComboModel.php (1)购买套餐时提交时进行表单验证:`$('#form').validator({})` (2)在店铺的账期结算中扣除相关费用并且在paycenter中添加交易记录 参数:店铺id,根据店铺id号获取店铺套餐详情 1、原套餐已经过期,更新套餐开始时间和结束时间 2、原套餐尚未过期,只需更新结束时间 3、如果没有套餐详情,则套餐购买