瀏覽代碼

update

master
shenjiachi 4 天之前
父節點
當前提交
17061b9620
共有 1 個檔案被更改,包括 5 行新增4 行删除
  1. +5
    -4
      app/svc/member_center/svc_user_management.go

+ 5
- 4
app/svc/member_center/svc_user_management.go 查看文件

@@ -6,9 +6,10 @@ import (
)

func UserManagementGetUsers(engine *xorm.Engine, req *md.UserManagementGetUserListReq) (*[]md.UserInfo, int64, error) {
var users []md.UserInfo
session := engine.SQL("SELECT a.*, user_tag_records.tag_id AS tag_id, b.phone AS parent_phone, b.system_invite_code AS parent_system_invite_code, b.custom_invite_code AS parent_custom_invite_code FROM `user` AS a, `user` AS b, `user_tag_records`" +
"WHERE a.parent_uid = b.id AND user_tag_records.uid = a.id")
users := make([]md.UserInfo, 0)
session := engine.Table("user").Alias("a").
Join("LEFT OUTER", []string{"user", "b"}, "a.parent_uid = b.id").
Join("LEFT OUTER", "user_tag_records", "user_tag_records.uid = a.id")
if req.ID != 0 {
session = session.Where("a.id = ?", req.ID)
}
@@ -60,7 +61,7 @@ func UserManagementGetUsers(engine *xorm.Engine, req *md.UserManagementGetUserLi
if req.LoginBefore != "" && req.LoginAfter != "" {
session = session.Where("a.update_at > ? and a.update_at < ?", req.LoginBefore, req.LoginAfter)
}
total, err := session.Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&users)
total, err := session.Limit(req.Limit, (req.Page-1)*req.Limit).Asc("a.id").FindAndCount(&users)
if err != nil {
return nil, 0, err
}


Loading…
取消
儲存