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

修改领导项目接口

... ... @@ -650,7 +650,7 @@ class PersonController extends RestBaseController
foreach($files as $k=>$file){
//移动到框架应用根目录/public/uploads/ 目录下
$moveUrl = ROOT_PATH . 'public' . DS . 'uploads';
//允许文件大小200k
//允许文件大小20M
$info = $file->validate(['size'=>20480000,'ext'=>'jpg,png,gif,mp3,pcm,wma,wav,mp4,avi,wmv,rm,rmvb,mkv,mov'])->move($moveUrl);
if($info){
//上传至七牛云
... ...
... ... @@ -1076,10 +1076,10 @@ class CommonController extends RestBaseController
//根据企业id查询项目组名称
public function getProjectGroup($company_id,$party=''){
if(empty($party)){
//甲方
//甲方领导
$where = ['a_cid'=>$company_id];
}else{
//乙方
//乙方领导
$where = ['b_cid'=>$company_id];
}
$res = Db::name('project')
... ... @@ -1090,6 +1090,22 @@ class CommonController extends RestBaseController
return $res;
}
//根据企业id查询甲方总领导项目组名称
public function getAsProjectGroup(){
$company = Db::name('company')
->where(['u_ls_id'=>$this->userId,'pid'=>['<>',0]])
->field('id')
->select()
->toArray();
$a_cid_s = array_column($company,'id');
$res = Db::name('project')
->whereIn('a_cid',$a_cid_s)
->field('id,name project_name')
->select()
->toArray();
return $res;
}
//获取甲乙方领导巡检列表
public function getInspectReportList($table,$pids,$data){
$limit = config('site.limit');
... ...
... ... @@ -29,7 +29,6 @@ class InformationController extends RestBaseController
* @method GET
*
* @header name:token require:1 default: desc:header
* @param name:company_id type:inter require:0 default: other desc:公司id(如果是总领导有此字段)
*
* @return project_a:字母排序['b','c']
* @return project_n:项目名称@
... ... @@ -38,20 +37,22 @@ class InformationController extends RestBaseController
*/
public function getProjectGroup(){
if($this->request->isGet()){
$company_id = $this->request->get('company_id');
$common = new CommonController();
$user = $common->getUserIdentity();
//根据企业id查询项目组名称
$res = [];
if($user['identity'] == config('site.a_leader')){
//项目组
//甲方领导
$res = $common->getProjectGroup($user['company_id']);
}else if($user['identity'] == config('site.a_leaders')){
$res = $common->getProjectGroup($company_id);
//甲方总领导
$res = $common->getAsProjectGroup();
}else if($user['identity'] == config('site.b_leader')){
//乙方领导
$res = $common->getProjectGroup($user['company_id'],1);
}
... ...