12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace addons\shopro\controller;
- class Coupons extends Base
- {
- protected $noNeedLogin = ['lists', 'detail', 'goods'];
- protected $noNeedRight = ['*'];
-
- public function index()
- {
- $type = $this->request->get('type');
- $this->success('优惠券中心', \addons\shopro\model\Coupons::getCouponsList($type));
- }
- public function lists()
- {
- $ids = $this->request->get('ids');
- $this->success('优惠券列表', \addons\shopro\model\Coupons::getCouponsListByIds($ids));
- }
- public function get()
- {
- $id = $this->request->get('id');
- $this->success('领取成功', \addons\shopro\model\Coupons::getCoupon($id));
- }
- public function detail()
- {
- $id = $this->request->get('id');
- $user_coupons_id = $this->request->get('user_coupons_id', 0);
- $detail = \addons\shopro\model\Coupons::getCouponsDetail($id, $user_coupons_id);
- $this->success('优惠券详情', $detail);
- }
- public function goods()
- {
- $id = $this->request->get('id');
- $detail = \addons\shopro\model\Coupons::getGoodsByCoupons($id);
- $this->success('优惠券详情', $detail);
- }
- }
|