update:更新权限系统

This commit is contained in:
JaguarJack
2021-03-31 20:20:21 +08:00
parent d4020b93a3
commit 2b96f3b650
15 changed files with 582 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ use catchAdmin\permissions\model\search\UserSearch;
use catcher\base\CatchModel;
use catcher\exceptions\FailedException;
use catcher\Utils;
use think\Paginator;
class Users extends CatchModel
{
@@ -47,16 +48,25 @@ class Users extends CatchModel
* 用户列表
*
* @time 2019年12月08日
* @throws \think\db\exception\DbException
* @return \think\Paginator
* @return array|\think\Paginator
*@throws \think\db\exception\DbException
*/
public function getList(): \think\Paginator
public function getList()
{
return $this->withoutField(['updated_at'], true)
$users = $this->withoutField(['updated_at', 'password', 'remember_token'], true)
->catchSearch()
->catchLeftJoin(Department::class, 'id', 'department_id', ['department_name'])
->with(['jobs', 'roles'])
->order($this->aliasField('id'), 'desc')
->paginate();
->paginate()->toArray();
foreach ($users['data'] as &$user) {
$user['roles'] = array_column($user['roles'], 'id');
$user['jobs'] = array_column($user['jobs'], 'id');
}
return Paginator::make($users['data'], $users['per_page'], $users['current_page'], $users['total']);
}
/**