作者 lyh

gx

@@ -49,28 +49,28 @@ class ProjectController extends BaseController @@ -49,28 +49,28 @@ class ProjectController extends BaseController
49 if(isset($this->param['type']) && $this->param['type'] == Project::TYPE_ZERO){ 49 if(isset($this->param['type']) && $this->param['type'] == Project::TYPE_ZERO){
50 $map[] = ['type',Project::TYPE_ZERO]; 50 $map[] = ['type',Project::TYPE_ZERO];
51 } 51 }
52 -// //搜索技术组  
53 -// if(!empty($this->param['dep_id'])){  
54 -// $map[] = ['id', 'in', DeployBuild::where('dept_id', $this->param['dep_id'])->pluck('project_id')->toArray()];  
55 -// }  
56 -// //搜索技术人员  
57 -// if(!empty($this->param['manage_id'])){  
58 -// $map[] = ['id', 'in', DeployBuild::where('leader_mid', $this->param['manage_id'])  
59 -// ->orwhere('manager_mid', $this->param['manage_id'])  
60 -// ->orwhere('designer_mid', $this->param['manage_id'])  
61 -// ->orwhere('tech_mid', $this->param['manage_id'])  
62 -// ->pluck('project_id')  
63 -// ->toArray()];  
64 -// }  
65 -// //按类型搜索  
66 -// if(!empty($this->param['search']) && !empty($this->param['search_type'])){  
67 -// if($this->param['search_type'] == 'domain'){  
68 -// //搜索域名  
69 -// $map[] = ['id', 'in', DeployOptimize::where('domain', 'like', "%{$this->param['search']}%")->pluck('project_id')->toArray()];  
70 -// }else{  
71 -// $map[] = [$this->param['search_type'], 'like', "%{$this->param['search']}%"];  
72 -// }  
73 -// } 52 + //搜索技术组
  53 + if(!empty($this->param['dep_id'])){
  54 + $map[] = ['id', 'in', DeployBuild::where('dept_id', $this->param['dep_id'])->pluck('project_id')->toArray()];
  55 + }
  56 + //搜索技术人员
  57 + if(!empty($this->param['manage_id'])){
  58 + $map[] = ['id', 'in', DeployBuild::where('leader_mid', $this->param['manage_id'])
  59 + ->orwhere('manager_mid', $this->param['manage_id'])
  60 + ->orwhere('designer_mid', $this->param['manage_id'])
  61 + ->orwhere('tech_mid', $this->param['manage_id'])
  62 + ->pluck('project_id')
  63 + ->toArray()];
  64 + }
  65 + //按类型搜索
  66 + if(!empty($this->param['search']) && !empty($this->param['search_type'])){
  67 + if($this->param['search_type'] == 'domain'){
  68 + //搜索域名
  69 + $map[] = ['id', 'in', DeployOptimize::where('domain', 'like', "%{$this->param['search']}%")->pluck('project_id')->toArray()];
  70 + }else{
  71 + $map[] = [$this->param['search_type'], 'like', "%{$this->param['search']}%"];
  72 + }
  73 + }
74 $sort = ['id' => 'desc']; 74 $sort = ['id' => 'desc'];
75 $data = $logic->getList($map, $sort,['*'],$this->row); 75 $data = $logic->getList($map, $sort,['*'],$this->row);
76 return $this->success($data); 76 return $this->success($data);
@@ -249,6 +249,8 @@ class Logic @@ -249,6 +249,8 @@ class Logic
249 } 249 }
250 switch ($v[1]) { 250 switch ($v[1]) {
251 case 'like': 251 case 'like':
  252 + var_dump($v[1]);
  253 + die();
252 // like查询 ['name|title', 'like', '%a%'] 254 // like查询 ['name|title', 'like', '%a%']
253 if (strpos($v[0], '|') !== false) { 255 if (strpos($v[0], '|') !== false) {
254 $query->where(function ($query) use ($v) { 256 $query->where(function ($query) use ($v) {