作者 jinglong
1 个管道 的构建 通过 耗费 3 秒

修改日检谁监测显示谁

... ... @@ -692,7 +692,6 @@ class PersonController extends RestBaseController
$res = $this->getAboutUs('service_mobile');
$res['explain_url'] = 'http://xiaofang.w.bronet.cn/explain.html';
$res['introduce_url'] = 'http://xiaofang.w.bronet.cn/introduce.html';
$res['manual_url'] = 'http://xiaofang.w.bronet.cn/manual.html';
$this->success('成功',$res);
}else{
$this->error('请求方式错误!');
... ... @@ -742,4 +741,23 @@ class PersonController extends RestBaseController
->find();
return $res;
}
/**
* @title 获取登录说明
* @description 接口说明
* @author 开发者
* @url /api/admin/person/getLoginManual
* @method GET
* @param name:is_token type:int require:1 default: other: desc:不用带token标识(传1)
*
* @return manual_url:登录页使用说明url
*/
public function getLoginManual(){
if($this->request->isGet()){
$res['manual_url'] = 'http://xiaofang.w.bronet.cn/manual.html';
$this->success('成功',$res);
}else{
$this->error('请求方式错误!');
}
}
}
... ...
... ... @@ -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;
}
}
... ...
... ... @@ -71,14 +71,13 @@ class ReportController extends RestBaseController
$result = $common->getInspectReportList('inspect',$pIds,$data);
//查找项目组人员名称
foreach($result as &$value){
if($value['party'] == 0){
//甲方项目组
$user_group = $common->getUserByProject($value['project_id'],'id,a_sid');
$value['user_group'] = trim(implode(array_column($user_group,'user_login'),'/'),'/');
}else{
//乙方项目组
$value['user_group'] = $common->getUserByProjectId($value['project_id'],'id,b_sid');
}
//显示拍照的日检人员
$ins_data = [
'project_id'=>$value['project_id'],
'create_time'=>$value['create_time']
];
$user_group = $common->getUserNameByProjectId($ins_data);
$value['user_group'] = trim(implode(array_column($user_group,'user_login'),'/'),'/');
}
$total_page = $common->getInspectReportCount('inspect',$pIds,$data);
$res['data'] = $result;
... ...