作者 lyh

gx

... ... @@ -49,28 +49,28 @@ class ProjectController extends BaseController
if(isset($this->param['type']) && $this->param['type'] == Project::TYPE_ZERO){
$map[] = ['type',Project::TYPE_ZERO];
}
// //搜索技术组
// if(!empty($this->param['dep_id'])){
// $map[] = ['id', 'in', DeployBuild::where('dept_id', $this->param['dep_id'])->pluck('project_id')->toArray()];
// }
// //搜索技术人员
// if(!empty($this->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($this->param['search']) && !empty($this->param['search_type'])){
// if($this->param['search_type'] == 'domain'){
// //搜索域名
// $map[] = ['id', 'in', DeployOptimize::where('domain', 'like', "%{$this->param['search']}%")->pluck('project_id')->toArray()];
// }else{
// $map[] = [$this->param['search_type'], 'like', "%{$this->param['search']}%"];
// }
// }
//搜索技术组
if(!empty($this->param['dep_id'])){
$map[] = ['id', 'in', DeployBuild::where('dept_id', $this->param['dep_id'])->pluck('project_id')->toArray()];
}
//搜索技术人员
if(!empty($this->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($this->param['search']) && !empty($this->param['search_type'])){
if($this->param['search_type'] == 'domain'){
//搜索域名
$map[] = ['id', 'in', DeployOptimize::where('domain', 'like', "%{$this->param['search']}%")->pluck('project_id')->toArray()];
}else{
$map[] = [$this->param['search_type'], 'like', "%{$this->param['search']}%"];
}
}
$sort = ['id' => 'desc'];
$data = $logic->getList($map, $sort,['*'],$this->row);
return $this->success($data);
... ...
... ... @@ -249,6 +249,8 @@ class Logic
}
switch ($v[1]) {
case 'like':
var_dump($v[1]);
die();
// like查询 ['name|title', 'like', '%a%']
if (strpos($v[0], '|') !== false) {
$query->where(function ($query) use ($v) {
... ...