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

增加独立年检列表搜索,报表详情

... ... @@ -267,7 +267,7 @@ class PersonController extends RestBaseController
$this->error('手机号格式有误');
}
$mobile_code = rand(100000, 999999);
$content = "【恒瑞消防】您的验证码为".$mobile_code.",如非本人操作请忽略本短信!";
$content = "【费尔曼】您的验证码为".$mobile_code.",如非本人操作请忽略本短信!";
$info = $mc->where([
'mobile' => $mobile,
'create_date' => date('Y-m-d')
... ...
... ... @@ -28,6 +28,8 @@ return array (
'service_exercise' => 6,
//年检
'service_years' => 7,
//年检
'service_test' => 8,
//提示语
'tips' => '不负重任,防患未燃!',
//消防日检暂时设为乙方
... ... @@ -42,77 +44,77 @@ return array (
//报修甲方发起,提醒指派乙方员工
'repair_content_add_a' => '甲方发起一个报修申请,等待您前往确认',
'repair_content_add_a' => '【报修提醒】甲方发起一个报修申请,等待您前往确认',
//报修乙方发起,提醒指派甲方员工
'repair_content_add_b' => '乙方发起一个报修申请,等待您前往确认',
'repair_content_add_b' => '【报修提醒】乙方发起一个报修申请,等待您前往确认',
//报修甲方员工确认,提醒发起乙方员工
'repair_content_confirm_a' => '甲方员工已确认信息,等待设备维修',
'repair_content_confirm_a' => '【报修提醒】甲方员工已确认信息,等待设备维修',
//报修乙方员工确认,提醒发起甲方员工
'repair_content_confirm_b' => '乙方员工已确认信息,等待设备维修',
'repair_content_confirm_b' => '【报修提醒】乙方员工已确认信息,等待设备维修',
//报修提交申请,提醒指派的甲方员工
'repair_content_finish_a' => '乙方员工提交报修验收申请,等待您的验收',
'repair_content_finish_a' => '【报修提醒】乙方员工提交报修验收申请,等待您的验收',
//报修甲方确认完成,提醒系统设置人员
'repair_content_finish' => '甲方验收完成,设备维修完毕',
'repair_content_finish' => '【报修提醒】甲方验收完成,设备维修完毕',
//改造甲方发起,提醒指派乙方员工
'reform_content_add_a' => '甲方发起一个改造申请,等待您前往确认',
'reform_content_add_a' => '【改造提醒】甲方发起一个改造申请,等待您前往确认',
//改造乙方发起,提醒指派甲方员工
'reform_content_add_b' => '乙方发起一个改造申请,等待您前往确认',
'reform_content_add_b' => '【改造提醒】乙方发起一个改造申请,等待您前往确认',
//改造甲方员工确认,提醒发起乙方员工
'reform_content_confirm_a' => '甲方员工已确认信息,等待设备改造',
'reform_content_confirm_a' => '【改造提醒】甲方员工已确认信息,等待设备改造',
//改造乙方员工确认,提醒发起甲方员工
'reform_content_confirm_b' => '乙方员工已确认信息,等待设备改造',
'reform_content_confirm_b' => '【改造提醒】乙方员工已确认信息,等待设备改造',
//改造提交申请,提醒指派的甲方员工
'reform_content_finish_a' => '乙方员工提交改造验收申请,等待您的验收',
'reform_content_finish_a' => '【改造提醒】乙方员工提交改造验收申请,等待您的验收',
//改造甲方确认完成,提醒系统设置人员
'reform_content_finish' => '甲方验收完成,设备改造完毕',
'reform_content_finish' => '【改造提醒】甲方验收完成,设备改造完毕',
//培训甲方发起,提醒指派乙方员工
'train_content_add_a' => '甲方发起一个培训申请,等待您前往确认',
'train_content_add_a' => '【培训提醒】甲方发起一个培训申请,等待您前往确认',
//培训乙方员工确认,提醒发起甲方员工
'train_content_confirm_a' => '乙方员工已确认信息,等待完善培训单',
'train_content_confirm_a' => '【培训提醒】乙方员工已确认信息,等待完善培训单',
//培训乙方确认完成,提醒指派甲方员工
'train_content_finish_b' => '乙方员工确认完成,等待您前往确认完成',
'train_content_finish_b' => '【培训提醒】乙方员工确认完成,等待您前往确认完成',
//培训指派甲方员工确认完成,提醒指系统设置人员
'train_content_finish' => '双方验收完成,培训完成',
'train_content_finish' => '【培训提醒】双方验收完成,培训完成',
//演习甲方发起,提醒指派乙方员工
'exercise_content_add_a' => '甲方发起一个演习申请,等待您前往确认',
'exercise_content_add_a' => '【演习提醒】甲方发起一个演习申请,等待您前往确认',
//演习乙方员工确认,提醒发起甲方员工
'exercise_content_confirm_a' => '乙方员工已确认信息,等待完善演习单',
'exercise_content_confirm_a' => '【演习提醒】乙方员工已确认信息,等待完善演习单',
//演习乙方确认完成,提醒指派甲方员工
'exercise_content_finish_b' => '乙方员工确认完成,等待您前往确认完成',
'exercise_content_finish_b' => '【演习提醒】乙方员工确认完成,等待您前往确认完成',
//演习指派甲方确认完成,提醒指系统设置人员
'exercise_content_finish' => '双方验收完成,演习完成',
'exercise_content_finish' => '【演习提醒】双方验收完成,演习完成',
//月检乙方发起,提醒指派甲方员工
'check_content_add_b' => '乙方发起一个月检申请,等待您前往确认',
//年检乙方重新发起(被甲方员工驳回后),提醒指派甲方员工
'check_content_again_b' => '乙方重新发起一个月检申请,等待您前往确认',
//年检指派甲方员工确认,提醒发起乙方员工
'check_content_confirm_s' => '甲方员工已确认信息,等待完善月检单',
//年检指派甲方员工驳回,提醒发起乙方员工
'check_content_reject_s' => '甲方员工已驳回信息,等待您重新发起月检申请',
//年检完成指派甲方员工,提醒指派甲方员工
'check_content_finish_a' => '乙方员工提交月检验收申请,等待您的验收',
//年检乙方指派甲方确认完成,提醒系统指定人员
'check_content_finish' => '甲方验收完成,月检完成',
'check_content_add_b' => '【月检提醒】乙方发起一个月检申请,等待您前往确认',
//月检乙方重新发起(被甲方员工驳回后),提醒指派甲方员工
'check_content_again_b' => '【月检提醒】乙方重新发起一个月检申请,等待您前往确认',
//月检指派甲方员工确认,提醒发起乙方员工
'check_content_confirm_s' => '【月检提醒】甲方员工已确认信息,等待完善月检单',
//月检指派甲方员工驳回,提醒发起乙方员工
'check_content_reject_s' => '【月检提醒】甲方员工已驳回信息,等待您重新发起月检申请',
//月检完成指派甲方员工,提醒指派甲方员工
'check_content_finish_a' => '【月检提醒】乙方员工提交月检验收申请,等待您的验收',
//月检乙方指派甲方确认完成,提醒系统指定人员
'check_content_finish' => '【月检提醒】甲方验收完成,月检完成',
//年检乙方发起,提醒指派甲方员工
'year_content_add_b' => '乙方发起一个年检申请,等待您前往确认',
'year_content_add_b' => '【年检提醒】乙方发起一个年检申请,等待您前往确认',
//年检乙方重新发起(被甲方员工驳回后),提醒指派甲方员工
'year_content_again_b' => '乙方重新发起一个年检申请,等待您前往确认',
'year_content_again_b' => '【年检提醒】乙方重新发起一个年检申请,等待您前往确认',
//年检指派甲方员工确认,提醒发起乙方员工
'year_content_confirm_s' => '甲方员工已确认信息,等待完善年检单',
'year_content_confirm_s' => '【年检提醒】甲方员工已确认信息,等待完善年检单',
//年检指派甲方员工驳回,提醒发起乙方员工
'year_content_reject_s' => '甲方员工已驳回信息,等待您重新发起年检申请',
'year_content_reject_s' => '【年检提醒】甲方员工已驳回信息,等待您重新发起年检申请',
//年检完成指派甲方员工,提醒指派甲方员工
'year_content_finish_a' => '乙方员工提交年检验收申请,等待您的验收',
'year_content_finish_a' => '【年检提醒】乙方员工提交年检验收申请,等待您的验收',
//年检乙方指派甲方确认完成,提醒系统指定人员
'year_content_finish' => '甲方验收完成,年检完成',
'year_content_finish' => '【年检提醒】甲方验收完成,年检完成',
... ...
... ... @@ -111,6 +111,10 @@ class CheckController extends RestBaseController
}
$common = new CommonController();
$res = $common->getCheckList('check',$page,$project_id,'c.id,c.title,u.user_login,c.status,c.ins_m_time,c.h_uid,c.finish_uid');
$project = $common->getProjectName($project_id);
foreach ($res as &$value){
$value['title'] = $project['project_name'].'月检'.date('Y-m-d',$value['ins_m_time']);
}
//查询总页数
$total_page = $common->getCheckPage('check');
$this->success('成功',['data'=>$res,'page'=>intval($page),'total_page'=>$total_page]);
... ...
... ... @@ -66,22 +66,16 @@ class CommonController extends RestBaseController
$result['service'] = $rule;
if($res['pid'] != 0){
foreach($result['service'] as &$value){
if($value['id'] != 101 && $value['id'] != 102){
if($value['id'] != 100){
$value['name'] = $value['name'].'报表';
if($value['id'] == 4){
$value['name'] = '维修报表';
}
}
}
$result['identity'] = config('site.a_leader');
}else{
//乙方
foreach($result['service'] as &$value){
if($value['id'] != 101 && $value['id'] != 102){
if($value['id'] != 100){
$value['name'] = $value['name'].'报表';
if($value['id'] == 4){
$value['name'] = '维修报表';
}
}
}
$result['identity'] = config('site.b_leader');
... ... @@ -120,24 +114,25 @@ class CommonController extends RestBaseController
'english_name' => '',
'icon' => $host.'/uploads/20190621/300e16a3ec39a4cc8e536d0b911d9f48.png'
];
if(!empty($mark)){
if($flag == 1){
array_push($rule,$add);
}
}
$identity = $this->user['identity'];
if($identity != 0){
if(empty($leaders)){
//不是总领导,即领导
$information = [
'id' => 101,
'name' => '消息审批',
'english_name' => 'Message approval',
'icon' => $host.'/uploads/20190626/4404bf86c659e82c3d22e5587865bdc4.png'
];
array_push($rule,$information);
}
}
array_push($rule,$add);
// if(!empty($mark)){
// if($flag == 1){
// array_push($rule,$add);
// }
// }
// $identity = $this->user['identity'];
// if($identity != 0){
// if(empty($leaders)){
// //不是总领导,即领导
// $information = [
// 'id' => 101,
// 'name' => '消息审批',
// 'english_name' => 'Message approval',
// 'icon' => $host.'/uploads/20190626/4404bf86c659e82c3d22e5587865bdc4.png'
// ];
// array_push($rule,$information);
// }
// }
return $rule;
}
... ... @@ -597,6 +592,16 @@ class CommonController extends RestBaseController
return $res;
}
//获取独立年检的巡检信息
public function getInsTest($where,$field){
$res = Db::name('years')
->where($where)
->field($field)
->select()
->toArray();
return $res;
}
//查看是否有月检巡检
public function getInspectionCheck($where){
$res = Db::name('ins_check')
... ... @@ -605,6 +610,50 @@ class CommonController extends RestBaseController
return $res;
}
//获取独立年检巡检点详情
public function getTestPoint($where){
//查询项目的月检点
$res_test = Db::name('spot')
->where($where)
->field('id,spot_name')
->select()
->toArray();
if($res_test){
$testIns = $this->getInsTest($where,'status,spot_id,images,uid');
foreach ($res_test as &$value){
$value['status'] = 2;
foreach ($testIns as $ins_value){
if($value['id'] == $ins_value['spot_id']){
$value['status'] = $ins_value['status'];
$user = $this->getUserById(['id'=>$ins_value['uid']]);
if($user){
$value['user_login'] = $user['user_login'];
}else{
$value['user_login'] = '';
}
$images = $this->absolutionUrl($ins_value['images']);
$images = $this->getDayImages($images);
if($images){
$value['images'] = $images;
}else{
$value['images'] = [];
}
}
}
if(!isset($value['user_login'])){
$value['user_login'] = '';
}
if(!isset($value['images'])){
$value['images'] = [];
}
}
$result = $res_test;
}else{
$result = [];
}
return $result;
}
//查看是否有日检巡检
public function getInspection($where){
$res = Db::name('inspect')
... ... @@ -928,11 +977,19 @@ class CommonController extends RestBaseController
}
//获取年检检测点列表
public function getTestList($page){
public function getTestList($page,$title_id){
$u_s_id_s = $this->getUidB();
//获取登录人所在的项目
$limit = config('site.limit');
$res = Db::name('test')
->where('uid',$this->userId)
->whereIn('uid',$u_s_id_s)
->where(function ($query) use ($title_id) {
//标题id
$title_id = !empty($title_id)&&isset($title_id)?$title_id:'';
if (!empty($title_id)) {
$query->where('id', $title_id);
}
})
->field('id,title,test_time,address,remark')
->page($page,$limit)
->order('id desc')
... ... @@ -942,14 +999,41 @@ class CommonController extends RestBaseController
}
//查询年检检测点总页数
public function getTestPage(){
public function getTestPage($title_id){
$u_s_id_s = $this->getUidB();
$count = Db::name('test')
->where('uid',$this->userId)
->whereIn('uid',$u_s_id_s)
->where(function ($query) use ($title_id) {
//标题id
$title_id = !empty($title_id)&&isset($title_id)?$title_id:'';
if (!empty($title_id)) {
$query->where('id', $title_id);
}
})
->count();
$limit = config('site.limit');
return ceil($count/$limit);
}
//独立年检获取乙方人员
public function getUidB(){
$user = $this->getIdentity();
$u_s_id_s = [];
if($user['identity'] == config('site.b_leader')){
//乙方领导
$uid = ','.$this->userId.',';
$company = $this->getCompanyB($uid);
if($company){
$u_s_id_s = explode(',',trim($company['u_s_id'],','));
}
}else if($user['identity'] == config('site.b_staff')){
//乙方员工
$u_s_id_s = explode(',',$this->userId);
}
return $u_s_id_s;
}
//根据项目id获取甲方公司名称
public function getACompanyName($project_id){
//获取甲方id,乙方id
... ... @@ -2128,6 +2212,47 @@ class CommonController extends RestBaseController
return $arr;
}
//获取独立年检报表详情
public function getTestReportDetail($res,$data){
$arr = [];
//查找乙方发起人所在乙方公司
$uid = ','.$res['uid'].',';
$host = config('site.host');
$b_company = $this->getCompany(['u_s_id'=>['like','%'.$uid.'%']],'id,company_name,logo');
$arr['b_company']['company_name'] = !empty($b_company['company_name'])?$b_company['company_name']:'';
$arr['b_company']['logo'] = !empty($b_company['logo'])?$host.'/'.$b_company['logo']:'';
//报表标题
$arr['title'] = $res['title'].'独立年检报表';
//独立年检时间
$arr['test_time'] = $res['test_time'];
//独立年检点
$arr['test_point'] = $this->getTestPoint(['test_id'=>$res['id']]);
//地点
$arr['address'] = $res['address'];
//单号
$arr['number'] = $res['number'];
//备注
$arr['remark'] = $res['remark'];
//独立年检(乙方发起人)
$user = $this->getUserById(['id'=>$res['uid']]);
if($user){
$arr['user_login'] = $user['user_login'];
}else{
$arr['user_login'] = '';
}
//浏览报表人员
$arr['browse_name'] = $this->getBrowseName($res['id'],7);
$service = config('site.service_test');
//评价内容
$arr['comment'] = $this->getDiscuss($service,$data['id']);
return $arr;
}
//获取日检报表详情
public function getInspectReportDetail($res,$data){
$arr = [];
... ... @@ -2548,14 +2673,17 @@ class CommonController extends RestBaseController
$insUidModel->create($recordData);
}
//记录报表浏览人员 0:日检,1:月检,2:年检,3:维修,4:改造,5:培训,6:演习
//记录报表浏览人员 0:日检,1:月检,2:年检,3:维修,4:改造,5:培训,6:演习,7:独立年检
public function createReportUid($service_id,$type=0){
$recordData['type'] = $type;
$recordData['service_id'] = $service_id;
$recordData['uid'] = $this->userId;
$recordData['create_time'] = time();
$reportUidModel = new ReportBrowseModel();
$reportUidModel->create($recordData);
$identity = $this->getIdentity();
if($identity['identity'] != config('site.a_leaders')){
$reportUidModel = new ReportBrowseModel();
$reportUidModel->create($recordData);
}
}
//根据项目id获取日检参与人员
... ... @@ -2640,4 +2768,26 @@ class CommonController extends RestBaseController
return $res;
}
//乙方领导id查询独立年检title
public function getYearsTitle(){
$u_s_id_s = $this->getUidB();
$res = Db::name('test')
->whereIn('uid',$u_s_id_s)
->field('id,title')
->order('id desc')
->select()
->toArray();
return $res;
}
//根据乙方领导uid查询所在乙方企业
public function getCompanyB($u_l_id){
$res = Db::name('company')
->where('u_l_id','like',"%$u_l_id%")
->where('pid',0)
->field('id,u_s_id')
->find();
return $res;
}
}
... ...
... ... @@ -33,7 +33,7 @@ class IndexController extends RestBaseController
* @return company_name:公司名称
* @return logo:公司logo
* @return service:企业拥有的服务@
* @service id:服务id(1:巡检,2:月检,3:改造,4:报修跟进,5:培训,6:演习,7:年检,100:使用说明,101:消息审批) name:服务名称 icon:图标路径
* @service id:服务id(1:日检,2:月检,3:改造,4:维修,5:培训,6:演习,7:年检,100:使用说明) name:服务名称 icon:图标路径
* @return run_time:0 运行时间
* @return is_finish:未检修数量(甲乙方员工有此字段)
* @return tips:提示语
... ... @@ -77,9 +77,7 @@ class IndexController extends RestBaseController
*
* @return data: @
* @data id:公司id company_name:甲方公司名称 logo:公司logo company_name_head:甲方总公司名称 address:地区 run_time:运行时间 service:服务列表@
* @service id:服务id(1:消防日检,2:月检,3:改造,4:报修,5:培训,6:演习,7:年检,101:消息审批) name:服务名称 icon:图标路径 english_name:英文名称
* @return address: @
* @address id:地区id(和公司id对应) address:地区
* @service id:服务id(1:日检,2:月检,3:改造,4:维修,5:培训,6:演习,7:年检,100:使用说明) name:服务名称 icon:图标路径 english_name:英文名称
* @return tips:提示语
*/
public function chiefLeaderIndex(){
... ... @@ -101,11 +99,8 @@ class IndexController extends RestBaseController
$rule = $common->getRule($data,'',1);
$value['service'] = $rule;
foreach($value['service'] as &$value1){
if($value1['id'] != 101 && $value1['id'] != 102){
if($value1['id'] != 100){
$value1['name'] = $value1['name'].'报表';
if($value['id'] == 4){
$value['name'] = '维修报表';
}
}
}
$value['logo'] = $host.'/upload/'.$value['logo'];
... ... @@ -280,6 +275,25 @@ class IndexController extends RestBaseController
}
}
if(in_array('#',$acronym)){
$count = count($acronym);
foreach ($arr1 as $key=>$a_value){
if($a_value['acronym'] == '#'){
$arr1[$count-1] = $a_value;
}else{
$arr1[$key-1] = $a_value;
}
}
foreach($acronym as $key1=>$a_value1){
if($a_value1 == '#'){
$acronym[$count-1] = $a_value1;
}else{
$acronym[$key1-1] = $a_value1;
}
}
}
$arr2['project_a'] = $acronym;
$arr2['project_n'] = $arr1;
}
... ...
... ... @@ -78,6 +78,25 @@ class InformationController extends RestBaseController
}
}
if(in_array('#',$acronym)){
$count = count($acronym);
foreach ($arr1 as $key=>$a_value){
if($a_value['acronym'] == '#'){
$arr1[$count-1] = $a_value;
}else{
$arr1[$key-1] = $a_value;
}
}
foreach($acronym as $key1=>$a_value1){
if($a_value1 == '#'){
$acronym[$count-1] = $a_value1;
}else{
$acronym[$key1-1] = $a_value1;
}
}
}
$arr2['project_a'] = $acronym;
$arr2['project_n'] = $arr1;
}
... ...
... ... @@ -20,12 +20,12 @@ class ReportController extends RestBaseController
*
* @header name:token require:1 default: desc:header
*
* @param name:project_id type:inter require:0 default: other desc:项目id
* @param name:type type:inter require:0 default: other desc:类型(1:月检,2:年检,3:维修,4:改造,5:培训,6:演习 )
* @param name:project_id type:inter require:1 default: other desc:项目id(独立年检传-1)
* @param name:type type:inter require:1 default: other desc:类型(1:月检,2:年检,3:维修,4:改造,5:培训,6:演习,7:独立年检)
*
* @return title_a:字母排序['b','c']
* @return title_n:项目名称@
* @title_n acronym:字母 title_l:项目列表@
* @title_n acronym:字母 title_l:标题列表@
* @title_l id:列表标题id title:标题名称
*/
public function getTitleList(){
... ... @@ -59,6 +59,9 @@ class ReportController extends RestBaseController
}else if($type == 6){
//演习
$res = $common->getTitleById('exercise',$project_id);
}else if($type == 7){
//独立年检
$res = $common->getYearsTitle();
}
$arr2 = [];
... ... @@ -82,6 +85,24 @@ class ReportController extends RestBaseController
}
}
}
if(in_array('#',$acronym)){
$count = count($acronym);
foreach ($arr1 as $key=>$a_value){
if($a_value['acronym'] == '#'){
$arr1[$count-1] = $a_value;
}else{
$arr1[$key-1] = $a_value;
}
}
foreach($acronym as $key1=>$a_value1){
if($a_value1 == '#'){
$acronym[$count-1] = $a_value1;
}else{
$acronym[$key1-1] = $a_value1;
}
}
}
$arr2['title_a'] = $acronym;
$arr2['title_n'] = $arr1;
... ... @@ -246,7 +267,7 @@ class ReportController extends RestBaseController
* @param name:end_time type:inter require:0 default: other desc:开始日期(检索结束日期)
*
* @return data:列表@
* @data id:列表id project_id:项目id project_name:项目名称 title:表头信息 ins_m_time:(ins_m_time:月检时间,year_m_time:年检时间) user_group:参与人员 status:状态(0:待确认,1:甲方员工驳回,2:进行中,3:申请中,4:已完成)
* @data id:列表id project_id:项目id project_name:项目名称 title:表头信息(+日期格式) ins_m_time:(ins_m_time:月检时间,year_m_time:年检时间) user_group:参与人员 status:状态(0:待确认,1:甲方员工驳回,2:进行中,3:申请中,4:已完成)
* @return page:当前页数
* @return total_page:总页数
*/
... ... @@ -277,7 +298,11 @@ class ReportController extends RestBaseController
$result = $common->getCheckReportList('pro_check',$pIds,$data);
$total_page = $common->checkReportCount('pro_check',$pIds,$data);
}
$project = $common->getProjectName($data['project_id']);
foreach($result as &$value){
if($service_id == 1){
$value['title'] = $project['project_name'].'月检'.date('Y-m-d',$value['ins_m_time']);
}
//显示拍照的日检人员
if($service_id == 1){
$value['user_group'] = $common->getUserNameByServiceId($value['id'],1);
... ... @@ -635,6 +660,66 @@ class ReportController extends RestBaseController
}
/**
* @title 独立年检报表详情
* @description 接口说明
* @author 开发者
* @url /api/home/report/testReportDetail
* @method GET
*
* @header name:token require:1 default: desc:header
*
* @param name:id type:inter require:1 default: other desc:列表id
*
*
* @return b_company:乙方公司@!
* @b_company company_name:乙方公司 logo:公司logo
*
* @return title:报表名称
* @return test_time:年检时间
* @return user_login:乙方发起人
* @return number:独立年检单号
*
* @return browse_name:浏览报表人员@
* @browse_name id:用户id user_login:姓名
*
* @return test_point:独立年检点@!
* @test_point id:年检点id spot_name:独立年检点名称 status:年检状态(0:正常,1:故障,2:未检测) user_login:检测人员 images:年检图片@
* @images day:图片日期 image:图片路径@
* @image image_url:图片路径
*
* @return comment:评论内容
*
* @return address:年检地点
* @return remark:年检备注
*/
public function testReportDetail(){
if($this->request->isGet()){
$data = $this->request->get();
$rule = config('site.data');
$validate = new Validate($rule['rule'],$rule['msg']);
if (!$validate->check($data)) {
$this->error($validate->getError());
}
$arr = [];
$res = Db::name('test')
->where('id',$data['id'])
->find();
if($res){
//根据项目id获取项目名称,甲方公司名称,logo,乙方公司名称,logo
$common = new CommonController();
$arr = $common->getTestReportDetail($res,$data);
//人员浏览记录
$common->createReportUid($data['id'],7);
}
$this->success('成功',$arr);
}else{
$this->error('请求方式错误!');
}
}
/**
* @title 报修报表详情
* @description 接口说明
* @author 开发者
... ... @@ -956,7 +1041,7 @@ class ReportController extends RestBaseController
* @header name:token require:1 default: desc:header
*
* @param name:id type:inter require:1 default: other desc:列表id
* @param name:service_id type:inter require:1 default: other desc:服务id(1:日检,2:月检,3:改造,4:报修跟进,5:培训,6:演习,7:年检)
* @param name:service_id type:inter require:1 default: other desc:服务id(1:日检,2:月检,3:改造,4:报修跟进,5:培训,6:演习,7:年检,8:独立年检
* @param name:comment type:string require:1 default: other desc:评论内容
*/
public function comment(){
... ...
... ... @@ -76,14 +76,18 @@ class YearsController extends RestBaseController
* @header name:token require:1 default: desc:header
*
* @param name:page type:inter require:1 default: other desc:分页页码
* @param name:title_id type:inter require:0 default: other desc:标题id
*
*
* @return data: @
* @data id:年检检测id tile:项目标题 test_time:检测时间 address:检测地点 remark:检测备注
* @data id:年检检测id tile:标题名称 test_time:检测时间 address:检测地点 remark:检测备注
* @return page:当前页数
* @return total_page:总页数
*/
public function testList(){
if($this->request->isGet()){
$page = $this->request->get('page');
$title_id = $this->request->get('title_id');
$rule = config('site.pages_report');
$validate = new Validate($rule['rule'],$rule['msg']);
... ... @@ -91,9 +95,9 @@ class YearsController extends RestBaseController
$this->error($validate->getError());
}
$common = new CommonController();
$res = $common->getTestList($page);
$res = $common->getTestList($page,$title_id);
//查询总页数
$total_page = $common->getTestPage();
$total_page = $common->getTestPage($title_id);
$this->success('成功',['data'=>$res,'page'=>intval($page),'total_page'=>$total_page]);
}else{
$this->error('请求方式错误!');
... ...