...
|
...
|
@@ -29,7 +29,7 @@ class Index extends Api |
|
|
* Depart模型对象
|
|
|
* @var \app\admin\model\inspection\Depart
|
|
|
*/
|
|
|
protected $noNeedLogin = ["index_yqlist","getEquipmentList", "getwerther", "alarm_monitoring", "index_yqlistv2", "index_swlist", "reservoirTypes", "projectlist"];
|
|
|
protected $noNeedLogin = ["index_yqlist","selectflow","getEquipmentList", "getwerther", "alarm_monitoring", "index_yqlistv2", "index_swlist", "reservoirTypes", "projectlist"];
|
|
|
protected $noNeedRight = ['*'];
|
|
|
protected $model = null;
|
|
|
|
...
|
...
|
@@ -968,4 +968,29 @@ class Index extends Api |
|
|
$data = json_decode($data, true);
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 流量计查询
|
|
|
* @return void
|
|
|
*/
|
|
|
public function selectflow(){
|
|
|
$res=Db::name("reservoir_equipment")
|
|
|
->where("type",1)
|
|
|
->select();
|
|
|
$returndata=[];
|
|
|
foreach ($res as $k=>$v){
|
|
|
$resflow=Db::name("reservoir_flow")
|
|
|
->where("number",$res[$k]['apiKey'])
|
|
|
->order("id desc")
|
|
|
->find();
|
|
|
$returndata[$k]=[
|
|
|
"id"=>$res[$k]['id'],
|
|
|
"name"=>$res[$k]['name'],
|
|
|
"number"=>$res[$k]['apiKey'],
|
|
|
"instantaneous_value"=>$resflow['instantaneous_value'],
|
|
|
"cumulative_value"=>$resflow['cumulative_value'],
|
|
|
];
|
|
|
}
|
|
|
print_r($returndata);
|
|
|
}
|
|
|
} |
...
|
...
|
|