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

撤回图片分组

... ... @@ -670,7 +670,7 @@ class CommonController extends RestBaseController
$user_login = Db::name('user')
->whereIn('id',$b_sid)
->where('user_status',1)
->field('id,user_login')
->field('id,user_login,position')
->select()
->toArray();
if(empty($flag)){
... ... @@ -690,7 +690,7 @@ class CommonController extends RestBaseController
$user_login = Db::name('user')
->whereIn('id',$a_sid)
->where('user_status',1)
->field('id,user_login')
->field('id,user_login,position')
->select()
->toArray();
return $user_login;
... ... @@ -1533,21 +1533,6 @@ class CommonController extends RestBaseController
foreach($images as &$value){
$value['image_url'] = $host.$value['image_url'];
}
$images = $this->getDayImages($images);
}
}
return $images;
}
//日检相对路径转绝对路径
public function absolutionInspectUrl($images){
if(!empty($images)){
$host = config('site.host');
$images = unserialize($images);
if(is_array($images)){
foreach($images as &$value){
$value['image_url'] = $host.$value['image_url'];
}
}
}
return $images;
... ...
... ... @@ -392,4 +392,68 @@ class IndexController extends RestBaseController
$this->error('请求方式错误!');
}
}
/**
* @title 获取甲方员工列表
* @description 接口说明
* @author 开发者
* @url /api/home/index/getStaffListA
* @method GET
*
* @header name:token require:1 default: desc:header
*
* @param name:project_id type:inter require:1 default: other desc:项目id
*
* @return data:数据@
* @data id:负责人id user_login:负责人姓名 position:职位
*/
public function getStaffListA(){
if($this->request->isGet()){
$project_id = $this->request->get('project_id');
$rule = config('site.project_id');
$validate = new Validate($rule['rule'],$rule['msg']);
if (!$validate->check(['project_id'=>$project_id])) {
$this->error($validate->getError());
}
$common = new CommonController();
//根据项目id获取甲方uid
$users = $common->getUserByProject($project_id,'id,a_sid');
$this->success('成功',['data'=>$users]);
}else{
$this->error('请求方式错误!');
}
}
/**
* @title 获取乙方员工列表
* @description 接口说明
* @author 开发者
* @url /api/home/index/getStaffListB
* @method GET
*
* @header name:token require:1 default: desc:header
*
* @param name:project_id type:inter require:1 default: other desc:项目id
*
* @return data:数据@
* @data id:负责人id user_login:负责人姓名 position:职位
*/
public function getStaffListB(){
if($this->request->isGet()){
$project_id = $this->request->get('project_id');
$rule = config('site.project_id');
$validate = new Validate($rule['rule'],$rule['msg']);
if (!$validate->check(['project_id'=>$project_id])) {
$this->error($validate->getError());
}
$common = new CommonController();
//根据项目id获取甲方uid
$users = $common->getUserByProjectId($project_id,'id,b_sid',1);
$this->success('成功',['data'=>$users]);
}else{
$this->error('请求方式错误!');
}
}
}
... ...
... ... @@ -189,7 +189,7 @@ class InspectionController extends RestBaseController
//相对路径转绝对路径
if($res['images']){
$common = new CommonController();
$res['images'] = $common->absolutionInspectUrl($res['images']);
$res['images'] = $common->absolutionUrl($res['images']);
}
$this->success('成功',$res);
}else{
... ...