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
41
42
43
44
45
46
47
<?php
 
namespace app\operations\controller\plus\vip;
 
use app\operations\controller\Controller;
use app\operations\model\plus\vip\User as VipUserModel;
 
/**
 * VIP专区用户管理
 */
class User extends Controller
{
    /**
     * VIP专区用户列表
     */
    public function index()
    {
        $model = new VipUserModel;
        $list = $model->getList($this->postData());
        return $this->renderSuccess('', compact('list'));
    }
 
    /**
     * 删除VIP用户
     */
    public function delete($user_id)
    {
        $model = new VipUserModel;
        if ($model->where('user_id', $user_id)->update(['is_delete' => 1])) {
            return $this->renderSuccess('删除成功');
        }
        return $this->renderError('删除失败');
    }
    public function edit($user_id)
    {
        $model = new VipUserModel;
        $data = $model->where('user_id', $user_id)->find();
        if ($this->request->get()){
            return $this->renderSuccess('', compact('data'));
        }
        $param = $this->postData();
        if ($data->save($param)){
            return $this->renderSuccess('更新成功');
        }
        return $this->renderError('更新失败');
    }
}