Index.php
3.4 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
99
100
<?php
namespace addons\jiangxingapi\controller;
use app\common\controller\Api;
use think\addons\Controller;
use think\Db;
class Index extends Api
{
protected $noNeedLogin = ['*'];
protected $noNeedRight = ['*'];
protected $water_levelsql = "reservoir_rain_water_level_copy";//水位sql
protected $rain_rainfallsql = "reservoir_rain_rainfall_copy";//雨量sql
protected $dam_seepagesql = "reservoir_dam_seepage_copy";//渗流sql
protected $dam_isotonicsql = "reservoir_dam_isotonic_copy";//渗压sql
protected $dam_displacementsql = "reservoir_dam_displacement_copy";//渗压sql
/**
* 查询水位
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function water_level(){
$number=$this->request->param("number");//设备编号
$res=Db::name($this->water_levelsql)->where("number",$number)->select();
foreach ($res as $k=>$v){
$res[$k]['createtime']=date("Y-m-d H:i:s",$res[$k]['createtime']);
}
$this->success("查询成功",$res);
}
/**
* 查询雨量
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function rainfall(){
$number=$this->request->param("number");//设备编号
$res=Db::name($this->rain_rainfallsql)->where("number",$number)->select();
foreach ($res as $k=>$v){
$res[$k]['createtime']=date("Y-m-d H:i:s",$res[$k]['createtime']);
}
$this->success("查询成功",$res);
}
/**
* 查询渗流
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function transfusion(){
$number=$this->request->param("number");//设备编号
$res=Db::name($this->dam_seepagesql)->where("equipment_id",$number)->select();
foreach ($res as $k=>$v){
$res[$k]['createtime']=date("Y-m-d H:i:s",$res[$k]['createtime']);
}
$this->success("查询成功",$res);
}
/**
* 查询渗流
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function osmotic(){
$number=$this->request->param("number");//设备编号
$res=Db::name($this->dam_isotonicsql)->where("equipment_id",$number)->select();
foreach ($res as $k=>$v){
$res[$k]['createtime']=date("Y-m-d H:i:s",$res[$k]['createtime']);
}
$this->success("查询成功",$res);
}
/**
* 查询渗流
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function displacement(){
$number=$this->request->param("number");//设备编号
$res=Db::name($this->dam_displacementsql)->where("number",$number)->select();
foreach ($res as $k=>$v){
$res[$k]['createtime']=date("Y-m-d H:i:s",$res[$k]['createtime']);
}
$this->success("查询成功",$res);
}
}