AdminStroeController.php
3.0 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
// +----------------------------------------------------------------------
// | bronet [ 以客户为中心 以奋斗者为本 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.bronet.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Powerless < wzxaini9@gmail.com>
// +----------------------------------------------------------------------
namespace app\user\controller;
use cmf\controller\AdminBaseController;
use think\Db;
class AdminStroeController extends AdminBaseController
{
/**
* 店长列表
* @adminMenu(
* 'name' => '店长列表',
* 'parent' => 'user/AdminIndex/default1',
* 'display'=> true,
* 'hasView'=> true,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '店长列表',
* 'param' => ''
* )
*/
public function index()
{
$data = $this->request->param();
$where_member['status'] = array('neq',9);
$where_member['type'] = 2;
$list = Db::name('Member')->where($where_member)->paginate();
// 获取分页显示
$page = $list->render();
$this->assign('lists', $list);
$this->assign('page', $page);
// 渲染模板输出
return $this->fetch('admin_store/index');
}
/**
* 本站用户拉黑
* @adminMenu(
* 'name' => '本站用户拉黑',
* 'parent' => 'index',
* 'display'=> false,
* 'hasView'=> false,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '本站用户拉黑',
* 'param' => ''
* )
*/
public function ban()
{
$id = input('param.id', 0, 'intval');
if ($id) {
$result = Db::name("user")->where(["id" => $id, "user_type" => 2])->setField('user_status', 0);
if ($result) {
$this->success("会员拉黑成功!", "adminIndex/index");
} else {
$this->error('会员拉黑失败,会员不存在,或者是管理员!');
}
} else {
$this->error('数据传入失败!');
}
}
/**
* 本站用户启用
* @adminMenu(
* 'name' => '本站用户启用',
* 'parent' => 'index',
* 'display'=> false,
* 'hasView'=> false,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '本站用户启用',
* 'param' => ''
* )
*/
public function cancelBan()
{
$id = input('param.id', 0, 'intval');
if ($id) {
Db::name("user")->where(["id" => $id, "user_type" => 2])->setField('user_status', 1);
$this->success("会员启用成功!", '');
} else {
$this->error('数据传入失败!');
}
}
}