update
This commit is contained in:
parent
184ccc5473
commit
86192ad03e
@ -33,6 +33,7 @@ use app\common\model\dept\Orgs;
|
|||||||
*/
|
*/
|
||||||
class AdminLists extends BaseAdminDataLists implements ListsExtendInterface, ListsSearchInterface, ListsSortInterface,ListsExcelInterface
|
class AdminLists extends BaseAdminDataLists implements ListsExtendInterface, ListsSearchInterface, ListsSortInterface,ListsExcelInterface
|
||||||
{
|
{
|
||||||
|
private $where = [];
|
||||||
/**
|
/**
|
||||||
* @notes 设置导出字段
|
* @notes 设置导出字段
|
||||||
* @return string[]
|
* @return string[]
|
||||||
@ -118,8 +119,12 @@ class AdminLists extends BaseAdminDataLists implements ListsExtendInterface, Lis
|
|||||||
*/
|
*/
|
||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
|
$role_id = $this->request->get('role_id');
|
||||||
$adminLists = Admin::where($this->searchWhere)
|
if(!empty($role_id)){
|
||||||
|
$admin_id = AdminRole::where('role_id',$role_id)->column('admin_id');
|
||||||
|
$this->where[] = ['id','in',$admin_id];
|
||||||
|
}
|
||||||
|
$adminLists = Admin::where($this->searchWhere)->where($this->where)
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order($this->sortOrder)
|
->order($this->sortOrder)
|
||||||
->append(['role_id','disable_desc'])
|
->append(['role_id','disable_desc'])
|
||||||
@ -164,8 +169,7 @@ class AdminLists extends BaseAdminDataLists implements ListsExtendInterface, Lis
|
|||||||
*/
|
*/
|
||||||
public function count(): int
|
public function count(): int
|
||||||
{
|
{
|
||||||
return Admin::where($this->searchWhere)
|
return Admin::where($this->searchWhere)->where($this->where)->count();
|
||||||
->count();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function extend()
|
public function extend()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user