正在显示
2 个修改的文件
包含
23 行增加
和
4 行删除
@@ -15,6 +15,7 @@ class Index extends Api | @@ -15,6 +15,7 @@ class Index extends Api | ||
15 | protected $dam_seepagesql = "reservoir_dam_seepage_copy";//渗流sql | 15 | protected $dam_seepagesql = "reservoir_dam_seepage_copy";//渗流sql |
16 | protected $dam_isotonicsql = "reservoir_dam_isotonic_copy";//渗压sql | 16 | protected $dam_isotonicsql = "reservoir_dam_isotonic_copy";//渗压sql |
17 | protected $dam_displacementsql = "reservoir_dam_displacement_copy";//渗压sql | 17 | protected $dam_displacementsql = "reservoir_dam_displacement_copy";//渗压sql |
18 | + protected $reservoir_rain_flowsql = "reservoir_rain_flow";//流量sql | ||
18 | 19 | ||
19 | /** | 20 | /** |
20 | * 查询水位 | 21 | * 查询水位 |
@@ -97,4 +98,22 @@ class Index extends Api | @@ -97,4 +98,22 @@ class Index extends Api | ||
97 | $this->success("查询成功",$res); | 98 | $this->success("查询成功",$res); |
98 | } | 99 | } |
99 | 100 | ||
101 | + | ||
102 | + | ||
103 | + /** | ||
104 | + * 查询流量 | ||
105 | + * @return void | ||
106 | + * @throws \think\db\exception\DataNotFoundException | ||
107 | + * @throws \think\db\exception\ModelNotFoundException | ||
108 | + * @throws \think\exception\DbException | ||
109 | + */ | ||
110 | + public function flow(){ | ||
111 | + $number=$this->request->param("number");//设备编号 | ||
112 | + $res=Db::name($this->reservoir_rain_flowsql)->where("number",$number)->select(); | ||
113 | + foreach ($res as $k=>$v){ | ||
114 | + $res[$k]['createtime']=date("Y-m-d H:i:s",$res[$k]['createtime']); | ||
115 | + } | ||
116 | + $this->success("查询成功",$res); | ||
117 | + } | ||
118 | + | ||
100 | } | 119 | } |
@@ -413,7 +413,7 @@ class Jiangxingapi extends Api | @@ -413,7 +413,7 @@ class Jiangxingapi extends Api | ||
413 | } | 413 | } |
414 | } | 414 | } |
415 | /** | 415 | /** |
416 | - *添加坝体位移信息 | 416 | + *添加流量信息 |
417 | * @return void | 417 | * @return void |
418 | */ | 418 | */ |
419 | public function flow(){ | 419 | public function flow(){ |
@@ -452,7 +452,7 @@ class Jiangxingapi extends Api | @@ -452,7 +452,7 @@ class Jiangxingapi extends Api | ||
452 | } | 452 | } |
453 | } | 453 | } |
454 | /** | 454 | /** |
455 | - * 批量添加坝体位移信息 | 455 | + * 批量添加流量信息 |
456 | * @return void | 456 | * @return void |
457 | */ | 457 | */ |
458 | public function batch_flow(){ | 458 | public function batch_flow(){ |
@@ -460,14 +460,14 @@ class Jiangxingapi extends Api | @@ -460,14 +460,14 @@ class Jiangxingapi extends Api | ||
460 | $flow_data=$param['flow_data']; | 460 | $flow_data=$param['flow_data']; |
461 | 461 | ||
462 | if(empty($flow_data)){ | 462 | if(empty($flow_data)){ |
463 | - $this->error("坝体位移信息不能为空"); | 463 | + $this->error("流量信息不能为空"); |
464 | } | 464 | } |
465 | $createtime=time();//创建时间 | 465 | $createtime=time();//创建时间 |
466 | try { | 466 | try { |
467 | foreach ($flow_data as $k=>$v){ | 467 | foreach ($flow_data as $k=>$v){ |
468 | $equipment=Db::name("reservoir_equipment")->where('type',7)->where("deviceId",$v['number'])->find(); | 468 | $equipment=Db::name("reservoir_equipment")->where('type',7)->where("deviceId",$v['number'])->find(); |
469 | if(empty($equipment)){ | 469 | if(empty($equipment)){ |
470 | - $this->error($v['number'].":坝体位移设备编号错误"); | 470 | + $this->error($v['number'].":流量设备编号错误"); |
471 | continue; | 471 | continue; |
472 | } | 472 | } |
473 | $data[$k]=[ | 473 | $data[$k]=[ |
-
请 注册 或 登录 后发表评论