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

撤回图片分组

@@ -670,7 +670,7 @@ class CommonController extends RestBaseController @@ -670,7 +670,7 @@ class CommonController extends RestBaseController
670 $user_login = Db::name('user') 670 $user_login = Db::name('user')
671 ->whereIn('id',$b_sid) 671 ->whereIn('id',$b_sid)
672 ->where('user_status',1) 672 ->where('user_status',1)
673 - ->field('id,user_login') 673 + ->field('id,user_login,position')
674 ->select() 674 ->select()
675 ->toArray(); 675 ->toArray();
676 if(empty($flag)){ 676 if(empty($flag)){
@@ -690,7 +690,7 @@ class CommonController extends RestBaseController @@ -690,7 +690,7 @@ class CommonController extends RestBaseController
690 $user_login = Db::name('user') 690 $user_login = Db::name('user')
691 ->whereIn('id',$a_sid) 691 ->whereIn('id',$a_sid)
692 ->where('user_status',1) 692 ->where('user_status',1)
693 - ->field('id,user_login') 693 + ->field('id,user_login,position')
694 ->select() 694 ->select()
695 ->toArray(); 695 ->toArray();
696 return $user_login; 696 return $user_login;
@@ -1533,21 +1533,6 @@ class CommonController extends RestBaseController @@ -1533,21 +1533,6 @@ class CommonController extends RestBaseController
1533 foreach($images as &$value){ 1533 foreach($images as &$value){
1534 $value['image_url'] = $host.$value['image_url']; 1534 $value['image_url'] = $host.$value['image_url'];
1535 } 1535 }
1536 - $images = $this->getDayImages($images);  
1537 - }  
1538 - }  
1539 - return $images;  
1540 - }  
1541 -  
1542 - //日检相对路径转绝对路径  
1543 - public function absolutionInspectUrl($images){  
1544 - if(!empty($images)){  
1545 - $host = config('site.host');  
1546 - $images = unserialize($images);  
1547 - if(is_array($images)){  
1548 - foreach($images as &$value){  
1549 - $value['image_url'] = $host.$value['image_url'];  
1550 - }  
1551 } 1536 }
1552 } 1537 }
1553 return $images; 1538 return $images;
@@ -392,4 +392,68 @@ class IndexController extends RestBaseController @@ -392,4 +392,68 @@ class IndexController extends RestBaseController
392 $this->error('请求方式错误!'); 392 $this->error('请求方式错误!');
393 } 393 }
394 } 394 }
  395 +
  396 + /**
  397 + * @title 获取甲方员工列表
  398 + * @description 接口说明
  399 + * @author 开发者
  400 + * @url /api/home/index/getStaffListA
  401 + * @method GET
  402 + *
  403 + * @header name:token require:1 default: desc:header
  404 + *
  405 + * @param name:project_id type:inter require:1 default: other desc:项目id
  406 + *
  407 + * @return data:数据@
  408 + * @data id:负责人id user_login:负责人姓名 position:职位
  409 + */
  410 + public function getStaffListA(){
  411 + if($this->request->isGet()){
  412 + $project_id = $this->request->get('project_id');
  413 + $rule = config('site.project_id');
  414 + $validate = new Validate($rule['rule'],$rule['msg']);
  415 + if (!$validate->check(['project_id'=>$project_id])) {
  416 + $this->error($validate->getError());
  417 + }
  418 +
  419 + $common = new CommonController();
  420 + //根据项目id获取甲方uid
  421 + $users = $common->getUserByProject($project_id,'id,a_sid');
  422 + $this->success('成功',['data'=>$users]);
  423 + }else{
  424 + $this->error('请求方式错误!');
  425 + }
  426 + }
  427 +
  428 + /**
  429 + * @title 获取乙方员工列表
  430 + * @description 接口说明
  431 + * @author 开发者
  432 + * @url /api/home/index/getStaffListB
  433 + * @method GET
  434 + *
  435 + * @header name:token require:1 default: desc:header
  436 + *
  437 + * @param name:project_id type:inter require:1 default: other desc:项目id
  438 + *
  439 + * @return data:数据@
  440 + * @data id:负责人id user_login:负责人姓名 position:职位
  441 + */
  442 + public function getStaffListB(){
  443 + if($this->request->isGet()){
  444 + $project_id = $this->request->get('project_id');
  445 + $rule = config('site.project_id');
  446 + $validate = new Validate($rule['rule'],$rule['msg']);
  447 + if (!$validate->check(['project_id'=>$project_id])) {
  448 + $this->error($validate->getError());
  449 + }
  450 +
  451 + $common = new CommonController();
  452 + //根据项目id获取甲方uid
  453 + $users = $common->getUserByProjectId($project_id,'id,b_sid',1);
  454 + $this->success('成功',['data'=>$users]);
  455 + }else{
  456 + $this->error('请求方式错误!');
  457 + }
  458 + }
395 } 459 }
@@ -189,7 +189,7 @@ class InspectionController extends RestBaseController @@ -189,7 +189,7 @@ class InspectionController extends RestBaseController
189 //相对路径转绝对路径 189 //相对路径转绝对路径
190 if($res['images']){ 190 if($res['images']){
191 $common = new CommonController(); 191 $common = new CommonController();
192 - $res['images'] = $common->absolutionInspectUrl($res['images']); 192 + $res['images'] = $common->absolutionUrl($res['images']);
193 } 193 }
194 $this->success('成功',$res); 194 $this->success('成功',$res);
195 }else{ 195 }else{