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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
namespace app\station\controller\v1;
use app\station\model\BaseStationStatusModel;
use think\Controller;
/**
* 基站状态API接口控制器
* 负责基站状态的增删改查
* Class Region
* @package app\station\controller
*/
class BaseStationStatus extends Controller
{
/**
* 基站状态数据列表
*/
public function baseStationStatus_list()
{
$model=new BaseStationStatusModel;
$data=$model->selectBaseStationStatus_List();
if($data['code']==200){
if($data['data']){
return jsonSucc('','suceeess',$data['data']);
}else{
return jsonSucc('20065','Business line data does not exist');
}
}else{
return jsonSucc('20063','Query error please try again');
}
}
/**
* 添加基站状态
*/
public function baseStationStatus_add()
{
$parem=$this->request->post();
if($parem){
$model=new BaseStationStatusModel;
$result=$model->insertBaseStationStatus($parem);
if($result['code']==200){
return jsonSucc('200','suceess');
}else{
return jsonSucc('200001','error');
}
}else{
return jsonSucc('1000001','error');
}
}
/**
* 修改基站状态
*/
public function baseStationStatus_edit()
{
$parem=$this->request->post();
if($parem){
if(empty($parem['cate_id'])){
return jsonSucc('200001','参数不合法,无法修改');
}
$model=new BaseStationStatusModel;
$result=$model->updBaseStationStatus($parem);
if($result['code']==10001){
return jsonSucc('200001','id不存在');
}
if($result['code']==200){
return jsonSucc('200','suceess');
}else{
return jsonSucc('200001','error');
}
}else{
return jsonSucc('1000001','error');
}
}
/**
* 获取修改基站状态数据
*/
public function geteditBaseStationStatus()
{
$parem=$this->request->post();
$model=new BaseStationStatusModel;
$result=$model->updselectBaseStationStatus($parem);
if($result['code']==10001){
return jsonSucc('200001','暂无找到id');
}else{
return jsonSucc('','suceess',$result['data']);
}
}
/**
* 删除基站状态数据(软删除)
*/
public function baseStationStatus_del()
{
$parem=$this->request->post();
if($parem){
$model=new BaseStationStatusModel;
$result=$model->delBaseStationStatus($parem);
switch ($result['code']) {
case '10001':
return jsonSucc('200001','暂无找到id');
break;
case '200':
return jsonSucc('200','suceess');
break;
default:
return jsonSucc('1000001','error');
break;
}
}else{
return jsonSucc('1000001','error');
}
}
}