소스 검색

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
}


불러오는 중...
취소
저장