KehuController.php
1.1 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
<?php
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use app\admin\model\AdminMenuModel;
class KehuController extends AdminBaseController{
//显示客户列表
public function kehulist(){
$data = Db::name('customer_data') -> order('status') -> paginate(10);
$this -> assign('data',$data);
return $this -> fetch();
}
//查看用户资料
public function khlook(){
$id = input('post.id');
$data = Db::name('customer_data') -> where('id',$id) -> find();
return json_encode($data);
}
//修改客户状态
public function khup(){
$id = input('post.id');
$status = input('post.status');
$data = Db::name('customer_data') -> where('id',$id) -> update(['status'=>$status]);
if($data){
return true;
}else{
return false;
}
}
//删除客户资料
public function khdel(){
$id = input('post.id');
$data = Db::name('customer_data') -> where('id',$id) -> delete();
if($data){
return true;
}else{
return false;
}
}
}
?>