作者 景龙
1 个管道 的构建 通过 耗费 16 秒

调试检测时间限制

... ... @@ -2008,7 +2008,7 @@ class CommonController extends RestBaseController
//日检
$where = ['party'=>$res['party'],'project_id'=>$res['project_id']];
$field = 'id,status,uid,point_id,images,create_time';
$arr['inspect'] = $this->getInspectList($where,$field,$res['project_id'],'inspect');
$arr['inspect'] = $this->getInspectList($where,$field,$res['project_id'],'inspect',$res['create_time']);
//日检时间
$arr['inspect_time'] = $res['create_time'];
... ... @@ -2016,7 +2016,7 @@ class CommonController extends RestBaseController
//年检检测
$where = ['project_id'=>$res['project_id'],'test_id'=>$res['id']];
$field = 'id,status,uid,spot_id,images,create_time';
$arr['years'] = $this->getInspectList($where,$field,$res['project_id'],'years');
$arr['years'] = $this->getInspectList($where,$field,$res['project_id'],'years',$res['create_time']);
//检测时间
$arr['test_time'] = $res['test_time'];
... ... @@ -2068,9 +2068,12 @@ class CommonController extends RestBaseController
}
//获取巡检列表
public function getInspectList($where,$field,$project_id,$table){
public function getInspectList($where,$field,$project_id,$table,$ins_time){
$time = date('Y-m-d',$ins_time);
$time1 = date('Y-m-d',$ins_time+86400);
$res = Db::name($table)
->where($where)
->whereTime('create_time', [$time,$time1])
->field($field)
->select()
->toArray();
... ...