first commit
This commit is contained in:
65
app/adminapi/lists/user/UserGroupLists.php
Normal file
65
app/adminapi/lists/user/UserGroupLists.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
namespace app\adminapi\lists\user;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\user\UserGroup;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
|
||||
|
||||
/**
|
||||
* 用户分组列表
|
||||
* Class UserGroupLists
|
||||
* @package app\adminapi\listsuser
|
||||
*/
|
||||
class UserGroupLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author BD
|
||||
* @date 2024/04/25 01:04
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['name'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取用户分组列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author BD
|
||||
* @date 2024/04/25 01:04
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return UserGroup::where($this->searchWhere)
|
||||
->field(['id', 'name'])
|
||||
->append(['rule_num','user_num'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取用户分组数量
|
||||
* @return int
|
||||
* @author BD
|
||||
* @date 2024/04/25 01:04
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return UserGroup::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user