quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
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
<?php
 
namespace app\operations\controller\supplier\member;
 
use app\common\service\supplier\MemberService;
use app\operations\controller\Controller;
use app\operations\model\supplier\Order as MemberOrderModel;
 
/**
 * 供应商年卡订单管理
 */
class Order extends Controller
{
    /**
     * 年卡订单列表
     */
    public function index()
    {
        $model = new MemberOrderModel;
        $list = $model->getList($this->postData());
        return $this->renderSuccess('', compact('list'));
    }
 
    /**
     * 激活年卡
     */
    public function activate()
    {
        $orderId = $this->request->post('order_id');
        
        $memberService = new MemberService();
        $result = $memberService->activateMember($orderId);
        
        if (!$result) {
            return $this->renderError('激活年卡失败');
        }
        
        return $this->renderSuccess('年卡激活成功');
    }
}