|
@@ -389,12 +389,13 @@ class CompanyItem extends BaseController
|
|
|
public function getCompanyItemUserByName()
|
|
|
{
|
|
|
|
|
|
- $company_name = $this->request->post('company_name', '', 'trim');
|
|
|
-
|
|
|
+ $param = $this->request->only(['company_name'=>"","depart_id"=>""], 'post', 'trim');
|
|
|
+ $where=[["is_del","=",0]];
|
|
|
//先查询所有的部门id(包括子部门)
|
|
|
+ if($param['company_name']!='')$where[]=["name","like",'%' .$param['company_name']. '%'];
|
|
|
+ if($param['depart_id']!='')$where[]=["id","=",$param['id']];
|
|
|
$company_ids = Db::name("company_item")
|
|
|
- ->where(['is_del' => 0])
|
|
|
- ->whereLike('name', '%' . $company_name . '%')
|
|
|
+ ->where($where)
|
|
|
->column('id');
|
|
|
|
|
|
$pid = $company_ids;
|