- GetUsers支持分页
This commit is contained in:
@@ -55,7 +55,7 @@ func TransferLegacyWeixins() (err error) {
|
||||
if user.Name == "" {
|
||||
user.Name = user.Mobile
|
||||
}
|
||||
userList, err2 := dao.GetUsers(db, 0, "", nil, "", v.Tel)
|
||||
userList, _, err2 := dao.GetUsers(db, 0, "", nil, "", v.Tel, 0, -1)
|
||||
if err = err2; err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -265,8 +265,8 @@ func DeleteConfig(ctx *jxcontext.Context, key, configType string) (err error) {
|
||||
errList := errlist.New()
|
||||
userIDs, err2 := api2.RoleMan.GetRoleUserList(autils.NewRole(key, 0))
|
||||
if err = err2; err == nil && len(userIDs) > 0 {
|
||||
userList, err2 := GetUsers(ctx, 0, "", userIDs, "", "")
|
||||
if err = err2; err == nil {
|
||||
userList, totalCount, err2 := dao.GetUsers(dao.GetDB(), 0, "", userIDs, "", "", 0, -1)
|
||||
if err = err2; err == nil && totalCount > 0 {
|
||||
err = fmt.Errorf("还有人员在使用角色:%s,人员信息:%s", key, utils.MustMarshal(utils.Struct2Map(userList, "compact")))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,8 +155,15 @@ func OnDingDingMsg(msg map[string]interface{}) (callbackResponse *dingdingapi.Ca
|
||||
return api.DingDingAPI.Err2CallbackResponse(nil)
|
||||
}
|
||||
|
||||
func GetUsers(ctx *jxcontext.Context, userType int, keyword string, userIDs []string, userID2, mobile string) (userList []*model.User, err error) {
|
||||
return dao.GetUsers(dao.GetDB(), userType, keyword, userIDs, userID2, mobile)
|
||||
func GetUsers(ctx *jxcontext.Context, userType int, keyword string, userIDs []string, userID2, mobile string, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
||||
userList, totalCount, err := dao.GetUsers(dao.GetDB(), userType, keyword, userIDs, userID2, mobile, offset, pageSize)
|
||||
if err == nil {
|
||||
pagedInfo = &model.PagedInfo{
|
||||
TotalCount: totalCount,
|
||||
Data: userList,
|
||||
}
|
||||
}
|
||||
return pagedInfo, err
|
||||
}
|
||||
|
||||
func GetStoreList4User(ctx *jxcontext.Context, mobileNum, userID string) (storeList []*dao.StoreWithCityName, err error) {
|
||||
|
||||
Reference in New Issue
Block a user