fix: 不查询内置用户和角色

This commit is contained in:
TsMask
2025-02-24 19:52:36 +08:00
parent 3380b6bfed
commit 5d5007bf1b
2 changed files with 2 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ type SysRole struct{}
// SelectByPage 分页查询集合
func (r SysRole) SelectByPage(query map[string]string) ([]model.SysRole, int64) {
tx := db.DB("").Model(&model.SysRole{})
tx = tx.Where("del_flag = '0'")
tx = tx.Where("del_flag = '0' and role_id > 1")
// 查询条件拼接
if v, ok := query["roleName"]; ok && v != "" {
tx = tx.Where("role_name like concat(?, '%')", v)

View File

@@ -20,7 +20,7 @@ type SysUser struct{}
// SelectByPage 分页查询集合
func (r SysUser) SelectByPage(query map[string]string, dataScopeSQL string) ([]model.SysUser, int64) {
tx := db.DB("").Model(&model.SysUser{})
tx = tx.Where("del_flag = '0'")
tx = tx.Where("del_flag = '0' and user_id > 1")
// 查询条件拼接
if v, ok := query["userId"]; ok && v != "" {
tx = tx.Where("user_id = ?", v)