feat:update userinfo
This commit is contained in:
1 parent
cb06f596e9
commit
b98997a69f
11 files changed
+42
-110
No files matched your search
+8
-9
@@ -216,19 +216,18 @@ func (e *SysUser) GetPage(pageSize int, pageIndex int) ([]SysUserPage, int, erro
|
||||
table = table.Where("sys_user.dept_id in (select dept_id from sys_dept where dept_path like ? )", "%"+tools.IntToString(e.DeptId)+"%")
|
||||
}
|
||||
|
||||
userid, _ := tools.StringToInt(e.DataScope)
|
||||
//dataPermission.UserId = userid
|
||||
//table, err := dataPermission.GetDataScope(e.TableName(), table)
|
||||
//if err != nil {
|
||||
// return 0, err
|
||||
//}
|
||||
|
||||
// 数据权限控制(如果不需要数据权限请将此处去掉)
|
||||
dataPermission := new(DataPermission)
|
||||
dataPermission.UserId, _ = tools.StringToInt(e.DataScope)
|
||||
table,err := dataPermission.GetDataScope(e.TableName(), table)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
var count int64
|
||||
|
||||
if err := table.Scopes(DataScopes(e.TableName(), userid)).Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&doc).Offset(-1).Limit(-1).Count(&count).Error; err != nil {
|
||||
if err := table.Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&doc).Offset(-1).Limit(-1).Count(&count).Error; err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
//table.Where("sys_user.deleted_at IS NULL").Count(&count)
|
||||
return doc, int(count), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user