|
...
|
...
|
@@ -83,8 +83,15 @@ class ProjectController extends BaseController |
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/30 10:11
|
|
|
|
*/
|
|
|
|
public function lists(){
|
|
|
|
|
|
|
|
public function lists(Project $project){
|
|
|
|
$map = [];
|
|
|
|
//类型
|
|
|
|
if(isset($this->map['type'])){
|
|
|
|
$map['type'] = $this->searchType($this->map['type']);
|
|
|
|
}
|
|
|
|
//搜索参数处理
|
|
|
|
$map = $this->searchParam($map,$this->map);
|
|
|
|
$project->formatQuery($map)->with()->paginate($this->row, ['*'], 'page', $this->page);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -95,18 +102,56 @@ class ProjectController extends BaseController |
|
|
|
* @time :2023/8/30 10:14
|
|
|
|
*/
|
|
|
|
public function searchType($type){
|
|
|
|
if(isset($this->param['type']) && $this->param['type'] == Project::TYPE_ZERO){
|
|
|
|
$this->param['type'] = Project::TYPE_ZERO;
|
|
|
|
//初始项目
|
|
|
|
if($type == Project::TYPE_ZERO){
|
|
|
|
$type = Project::TYPE_ZERO;
|
|
|
|
}
|
|
|
|
if(isset($this->param['type']) && $this->param['type'] == Project::TYPE_THREE){
|
|
|
|
$this->param['type'] = ['in',[Project::TYPE_FOUR,Project::TYPE_SIX]];
|
|
|
|
//建站中
|
|
|
|
if($type == Project::TYPE_ONE){
|
|
|
|
$type = Project::TYPE_ONE;
|
|
|
|
}
|
|
|
|
if(isset($this->param['type']) && $this->param['type'] == Project::TYPE_TWO){
|
|
|
|
$this->param['type'] = ['in',[Project::TYPE_TWO,Project::TYPE_THREE]];
|
|
|
|
//建站完成
|
|
|
|
if($type == Project::TYPE_TWO){
|
|
|
|
$type = ['in',[Project::TYPE_TWO,Project::TYPE_THREE]];
|
|
|
|
}
|
|
|
|
if(isset($this->param['type']) && $this->param['type'] == Project::TYPE_ONE){
|
|
|
|
$this->param['type'] = Project::TYPE_ONE;
|
|
|
|
if($this->param['type'] == Project::TYPE_THREE){
|
|
|
|
$type = ['in',[Project::TYPE_FOUR,Project::TYPE_SIX]];
|
|
|
|
}
|
|
|
|
return $type;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :搜索参数处理
|
|
|
|
* @name :searchParam
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/30 10:30
|
|
|
|
*/
|
|
|
|
public function searchParam(&$map,$param){
|
|
|
|
//搜索技术组
|
|
|
|
if(!empty($param['dep_id'])){
|
|
|
|
$map['id'] = ['in', DeployBuild::where('dept_id', $this->param['dep_id'])->pluck('project_id')->toArray()];
|
|
|
|
}
|
|
|
|
//搜索技术人员
|
|
|
|
if(!empty($param['manage_id'])){
|
|
|
|
$map['id'] = ['in', DeployBuild::where('leader_mid', $this->param['manage_id'])
|
|
|
|
->orwhere('manager_mid', $this->param['manage_id'])
|
|
|
|
->orwhere('designer_mid', $this->param['manage_id'])
|
|
|
|
->orwhere('tech_mid', $this->param['manage_id'])
|
|
|
|
->pluck('project_id')
|
|
|
|
->toArray()];
|
|
|
|
|
|
|
|
}
|
|
|
|
//按类型搜索
|
|
|
|
if(!empty($param['search']) && !empty($param['search_type'])){
|
|
|
|
if($this->param['search_type'] == 'domain'){
|
|
|
|
//搜索域名
|
|
|
|
$map['id'] = ['id', 'in', DeployOptimize::where('domain', 'like', "%{$this->param['search']}%")->pluck('project_id')->toArray()];
|
|
|
|
}else{
|
|
|
|
$map[$param['search_type']] = ['like', "%{$param['search']}%"];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $map;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|