更新小组角色

This commit is contained in:
yaooo 2023-11-24 14:19:26 +08:00
parent 93adb3d543
commit d802ff0c75

@ -4,6 +4,7 @@ namespace app\middleapi\controller;
use app\common\enum\user\AccountLogEnum;
use app\common\model\user\User;
use app\common\model\user\UserRole;
use app\common\enum\user\UserTerminalEnum;
use think\facade\Db;
use app\common\controller\BaseLikeAdminController;
@ -61,4 +62,28 @@ class UserController extends BaseLikeAdminController
return $this->success('请求成功',$result);
}
public function roleLists()
{
if(!$this->request->isPost()){
return $this->fail('请求方式错误');
}
$params = $this->request->post(['page_no','page_size']);
$pageNo = !empty($params['page_no']) ? $params['page_no'] : 1;
$pageSize = !empty($params['page_size']) ? $params['page_size'] : 20;
$lists = UserRole::field(['id', 'name', 'desc', 'menu_arr', 'sort'])
->page($pageNo, $pageSize)
->order(['id' => 'desc'])
->select()
->toArray();
$count = UserRole::count();
$result = [
'lists' => $lists,
'count' => $count,
'page_no' => $pageNo,
'page_size' => $pageSize
];
return $this->success('请求成功',$result);
}
}