fix: 不查询内置用户和角色
This commit is contained in:
@@ -18,7 +18,7 @@ type SysRole struct{}
|
|||||||
// SelectByPage 分页查询集合
|
// SelectByPage 分页查询集合
|
||||||
func (r SysRole) SelectByPage(query map[string]string) ([]model.SysRole, int64) {
|
func (r SysRole) SelectByPage(query map[string]string) ([]model.SysRole, int64) {
|
||||||
tx := db.DB("").Model(&model.SysRole{})
|
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 != "" {
|
if v, ok := query["roleName"]; ok && v != "" {
|
||||||
tx = tx.Where("role_name like concat(?, '%')", v)
|
tx = tx.Where("role_name like concat(?, '%')", v)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ type SysUser struct{}
|
|||||||
// SelectByPage 分页查询集合
|
// SelectByPage 分页查询集合
|
||||||
func (r SysUser) SelectByPage(query map[string]string, dataScopeSQL string) ([]model.SysUser, int64) {
|
func (r SysUser) SelectByPage(query map[string]string, dataScopeSQL string) ([]model.SysUser, int64) {
|
||||||
tx := db.DB("").Model(&model.SysUser{})
|
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 != "" {
|
if v, ok := query["userId"]; ok && v != "" {
|
||||||
tx = tx.Where("user_id = ?", v)
|
tx = tx.Where("user_id = ?", v)
|
||||||
|
|||||||
Reference in New Issue
Block a user