作者 郭文星

123

... ... @@ -15,6 +15,7 @@ class Index extends Api
protected $dam_seepagesql = "reservoir_dam_seepage_copy";//渗流sql
protected $dam_isotonicsql = "reservoir_dam_isotonic_copy";//渗压sql
protected $dam_displacementsql = "reservoir_dam_displacement_copy";//渗压sql
protected $reservoir_rain_flowsql = "reservoir_rain_flow";//流量sql
/**
* 查询水位
... ... @@ -97,4 +98,22 @@ class Index extends Api
$this->success("查询成功",$res);
}
/**
* 查询流量
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function flow(){
$number=$this->request->param("number");//设备编号
$res=Db::name($this->reservoir_rain_flowsql)->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);
}
}
... ...
... ... @@ -413,7 +413,7 @@ class Jiangxingapi extends Api
}
}
/**
*添加坝体位移信息
*添加流量信息
* @return void
*/
public function flow(){
... ... @@ -452,7 +452,7 @@ class Jiangxingapi extends Api
}
}
/**
* 批量添加坝体位移信息
* 批量添加流量信息
* @return void
*/
public function batch_flow(){
... ... @@ -460,14 +460,14 @@ class Jiangxingapi extends Api
$flow_data=$param['flow_data'];
if(empty($flow_data)){
$this->error("坝体位移信息不能为空");
$this->error("流量信息不能为空");
}
$createtime=time();//创建时间
try {
foreach ($flow_data as $k=>$v){
$equipment=Db::name("reservoir_equipment")->where('type',7)->where("deviceId",$v['number'])->find();
if(empty($equipment)){
$this->error($v['number'].":坝体位移设备编号错误");
$this->error($v['number'].":流量设备编号错误");
continue;
}
$data[$k]=[
... ...