ソースを参照

update

master
shenjiachi 1日前
コミット
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
}


読み込み中…
キャンセル
保存