quanwei
2 days ago 04102f7237efefa744090ed7c25f7b5d0807b679
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
<?php
 
namespace app\api\controller\plus\groupbuy;
 
use app\api\controller\Controller;
use app\api\model\plus\groupbuy\Active as ActiveModel;
 
/**
 * 团购活动控制器
 */
class Active extends Controller
{
    /**
     * 团购活动列表
     */
    public function lists($status = -1)
    {
        $param = [];
        $param['status'] = $status;
        $list = (new ActiveModel)->getList($param);
        return $this->renderSuccess('', compact('list'));
    }
 
    /**
     * 团购活动详情
     */
    public function detail($groupbuy_active_id)
    {
        $detail = ActiveModel::detail($groupbuy_active_id);
        if (empty($detail)) {
            return $this->renderError('活动不存在');
        }
        return $this->renderSuccess('', compact('detail'));
    }
 
    /**
     * 当前有效活动
     */
    public function valid()
    {
        $detail = ActiveModel::getValidActive();
        return $this->renderSuccess('', compact('detail'));
    }
}