Coupons.php
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?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);
}
}