|
@@ -29,7 +29,7 @@ class Index extends Api |
|
@@ -29,7 +29,7 @@ class Index extends Api |
29
|
* Depart模型对象
|
29
|
* Depart模型对象
|
30
|
* @var \app\admin\model\inspection\Depart
|
30
|
* @var \app\admin\model\inspection\Depart
|
31
|
*/
|
31
|
*/
|
32
|
- protected $noNeedLogin = ["index_yqlist","getEquipmentList", "getwerther", "alarm_monitoring", "index_yqlistv2", "index_swlist", "reservoirTypes", "projectlist"];
|
32
|
+ protected $noNeedLogin = ["index_yqlist","selectflow","getEquipmentList", "getwerther", "alarm_monitoring", "index_yqlistv2", "index_swlist", "reservoirTypes", "projectlist"];
|
33
|
protected $noNeedRight = ['*'];
|
33
|
protected $noNeedRight = ['*'];
|
34
|
protected $model = null;
|
34
|
protected $model = null;
|
35
|
|
35
|
|
|
@@ -968,4 +968,29 @@ class Index extends Api |
|
@@ -968,4 +968,29 @@ class Index extends Api |
968
|
$data = json_decode($data, true);
|
968
|
$data = json_decode($data, true);
|
969
|
return $data;
|
969
|
return $data;
|
970
|
}
|
970
|
}
|
|
|
971
|
+
|
|
|
972
|
+ /**
|
|
|
973
|
+ * 流量计查询
|
|
|
974
|
+ * @return void
|
|
|
975
|
+ */
|
|
|
976
|
+ public function selectflow(){
|
|
|
977
|
+ $res=Db::name("reservoir_equipment")
|
|
|
978
|
+ ->where("type",1)
|
|
|
979
|
+ ->select();
|
|
|
980
|
+ $returndata=[];
|
|
|
981
|
+ foreach ($res as $k=>$v){
|
|
|
982
|
+ $resflow=Db::name("reservoir_flow")
|
|
|
983
|
+ ->where("number",$res[$k]['apiKey'])
|
|
|
984
|
+ ->order("id desc")
|
|
|
985
|
+ ->find();
|
|
|
986
|
+ $returndata[$k]=[
|
|
|
987
|
+ "id"=>$res[$k]['id'],
|
|
|
988
|
+ "name"=>$res[$k]['name'],
|
|
|
989
|
+ "number"=>$res[$k]['apiKey'],
|
|
|
990
|
+ "instantaneous_value"=>$resflow['instantaneous_value'],
|
|
|
991
|
+ "cumulative_value"=>$resflow['cumulative_value'],
|
|
|
992
|
+ ];
|
|
|
993
|
+ }
|
|
|
994
|
+ print_r($returndata);
|
|
|
995
|
+ }
|
971
|
} |
996
|
} |