修改查询

This commit is contained in:
mkm 2023-07-24 10:33:22 +08:00
parent 3369f8535f
commit 838adb3d70
3 changed files with 11 additions and 3 deletions

View File

@ -39,7 +39,8 @@ class CompanyLists extends BaseAdminDataLists implements ListsSearchInterface
public function setSearch(): array public function setSearch(): array
{ {
return [ return [
'=' => ['level_two', 'level_one', 'company_name', 'organization_code', 'city', 'area', 'street', 'company_type', 'master_name', 'master_position', 'master_phone', 'master_email', 'other_contacts', 'area_manager', 'is_contract', 'account', 'password', 'deposit', 'deposit_time', 'qualification', 'status'], '=' => ['level_two', 'level_one', 'organization_code', 'city', 'area', 'street', 'company_type', 'master_name', 'master_position', 'master_phone', 'master_email', 'other_contacts', 'area_manager', 'is_contract', 'account', 'password', 'deposit', 'deposit_time', 'qualification', 'status'],
'%like%' => ['company_name'],
]; ];
} }

View File

@ -25,6 +25,7 @@ use app\common\model\auth\SystemRole;
use app\common\model\Company; use app\common\model\Company;
use app\common\model\dept\Dept; use app\common\model\dept\Dept;
use app\common\model\dept\Jobs; use app\common\model\dept\Jobs;
use think\facade\Db;
/** /**
* 管理员列表 * 管理员列表
@ -122,6 +123,13 @@ class AdminLists extends BaseAdminDataLists implements ListsExtendInterface, Lis
} }
if(isset($this->params['company_id']) && $this->params['company_id'] != ''){ if(isset($this->params['company_id']) && $this->params['company_id'] != ''){
$where[] = ['company_id', '=', $this->params['company_id']]; $where[] = ['company_id', '=', $this->params['company_id']];
}else{
if($this->adminInfo['root']!=1){
$column_id=Db::name('company')->where('level_two',$this->adminInfo['company_id'])->column('id');
array_push($column_id,$this->adminInfo['company_id']);
$where[]=['company_id','in',$column_id];
}
} }
return $where; return $where;
} }
@ -142,7 +150,6 @@ class AdminLists extends BaseAdminDataLists implements ListsExtendInterface, Lis
'id', 'name', 'account', 'create_time', 'disable', 'root', 'province', 'city', 'area', 'street', 'id', 'name', 'account', 'create_time', 'disable', 'root', 'province', 'city', 'area', 'street',
'login_time', 'login_ip', 'multipoint_login', 'avatar', 'company_id', 'is_contract', 'create_time' 'login_time', 'login_ip', 'multipoint_login', 'avatar', 'company_id', 'is_contract', 'create_time'
]; ];
$adminLists = Admin::field($field) $adminLists = Admin::field($field)
->where($this->searchWhere) ->where($this->searchWhere)
->where($this->queryWhere()) ->where($this->queryWhere())

@ -1 +1 @@
Subproject commit 1294ea49ff9ecc4532821f8798304816cbf8dd74 Subproject commit 9acc82cd23d807280ddd29df2117e7890094d049