...
|
...
|
@@ -1952,7 +1952,7 @@ class CommonController extends RestBaseController |
|
|
$arr = [];
|
|
|
if($flag == 'inspect'){
|
|
|
//日检
|
|
|
$company = $this->getCompanyName($res['project_id'],'巡检/日检');
|
|
|
$company = $this->getCompanyName($res['project_id'],'消防日检');
|
|
|
}else{
|
|
|
//年检
|
|
|
$company = $this->getCompanyName($res['project_id'],'年检');
|
...
|
...
|
@@ -1984,14 +1984,12 @@ class CommonController extends RestBaseController |
|
|
}
|
|
|
|
|
|
if($flag == 'inspect'){
|
|
|
//日检人员
|
|
|
if($res['party'] == 0){
|
|
|
//甲方项目组
|
|
|
$arr['inspect_name'] = $this->getUserByProject($res['project_id'],'id,a_sid');
|
|
|
}else{
|
|
|
//乙方项目组
|
|
|
$arr['inspect_name'] = $this->getUserByProjectId($res['project_id'],'id,b_sid',1);
|
|
|
}
|
|
|
//显示拍照的日检人员
|
|
|
$ins_data = [
|
|
|
'project_id'=>$res['project_id'],
|
|
|
'create_time'=>$res['create_time']
|
|
|
];
|
|
|
$arr['inspect_name'] = $this->getUserNameByProjectId($ins_data);
|
|
|
}else{
|
|
|
//乙方项目组
|
|
|
$arr['inspect_name'] = $this->getUserByProjectId($res['project_id'],'id,b_sid',1);
|
...
|
...
|
@@ -2376,4 +2374,26 @@ class CommonController extends RestBaseController |
|
|
$insUidModel->create($recordData);
|
|
|
}
|
|
|
|
|
|
//根据项目id获取日检人员
|
|
|
public function getUserNameByProjectId($data){
|
|
|
$time = date('Y-m-d',$data['create_time']);
|
|
|
$startTime = strtotime($time);
|
|
|
$endTime = $startTime+86400;
|
|
|
$users = Db::name('ins_record_uid')
|
|
|
->where('project_id',$data['project_id'])
|
|
|
->where('create_time', '>=', $startTime)
|
|
|
->where('create_time', '<=', $endTime)
|
|
|
->field('id,uid')
|
|
|
->select()
|
|
|
->toArray();
|
|
|
$u_ids = array_unique(array_values(array_column($users,'uid')));
|
|
|
$user_login = Db::name('user')
|
|
|
->whereIn('id',$u_ids)
|
|
|
->where('user_status',1)
|
|
|
->field('id,user_login')
|
|
|
->select()
|
|
|
->toArray();
|
|
|
return $user_login;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|