多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
文件路径:shop/controllers/Seller/Promotion/VoucherCtl.php 一、代金券管理列表【方法:index();】 * 控制器:shop/controllers/Seller/Promotion/VoucherCtl.php ->index() * 模型:shop/models/Voucher/TempModel.php shop/models/Voucher/quotaModel.php shop/models/Shop/BaseModel.php * 视图:shop/views/default/Seller/Promotion/VoucherCtl/index.php 1.活动状态 模型:shop/models/Voucher/TempModel.php 参数:voucher_t_state(1.有效 2.失效) ~~~ // 活动状态 (1.有效 2.失效) const VALID = 1;//有效 const INVALID = 2;//失效 ~~~ 2.领取方式 模型:shop/models/Voucher/TempModel.php 参数:voucher_t_access_method(1.积分兑换 2.卡密 3.免费领取) ~~~ // 领取方式 (1.积分兑换 2.卡密 3.免费领取) const GETBYPOINTS = 1;//积分兑换 const GETFBYPWD = 2;//卡密 const GETFREE = 3;//免费领取 ~~~ 3.活动详情 参数:detail、id 方法:index(); 视图:shop/views/default/Seller/Promotion/VoucherCtl/detail.php 根据URL获得参数detail、id来判断当前页面 ~~~ if (request_string('op') == 'detail') { $cond_row['voucher_t_id'] = request_int('id'); $this->view->setMet('detail'); //视图 $data = $this->voucherTempModel->getVoucherTempInfoByWhere($cond_row); if ($data['shop_class_id']) { $Shop_ClassModel = new Shop_ClassModel(); $shop_class_row = $Shop_ClassModel->getOne($data['shop_class_id']); $data['shop_class_name'] = $shop_class_row['shop_class_name']; } else { $data['shop_class_name'] = ''; } if ($data['voucher_t_user_grade_limit']) { $User_GradeModel = new User_GradeModel(); $grade_row = $User_GradeModel->getOne($data['voucher_t_user_grade_limit']); $data['voucher_t_user_grade_limit_label'] = $grade_row['user_grade_name']; } } ~~~ 4.删除代金券 * 控制器:shop/controllers/Seller/Promotion/VoucherCtl.php ->removeVoucherTemp() * 模型:shop/models/Voucher/TempModel.php * 视图:shop/views/default/Seller/Promotion/VoucherCtl/index.php 二、添加代金券 * 控制器:shop/controllers/Seller/Promotion/VoucherCtl.php ->add() * 模型:shop/models/Voucher/TempModel.php shop/models/Voucher/quotaModel.php shop/models/Shop/BaseModel.php * 视图:shop/views/default/Seller/Promotion/VoucherCtl/add.php 1.活动有效期:不能大于2030-06-11 00:00:00 2.提交 新增活动提交时进行表单验证:`$('#form').validator({})` 方法:addVoucherTemp()