邀请4人得会员

This commit is contained in:
苏尹岚
2020-11-24 08:42:25 +08:00
parent 6d54e23321
commit ec97835313
7 changed files with 76 additions and 22 deletions

View File

@@ -59,7 +59,7 @@ func GetUserByIDWithMembers(db *DaoDB, fieldName, fieldValue string) (getSelfInf
return getSelfInfoResult, err
}
func GetUsers(db *DaoDB, userType int, keyword string, userIDs, userID2s, mobiles []string, offset, pageSize int) (userList []*model.User, totalCount int, err error) {
func GetUsers(db *DaoDB, userType int, keyword, popUser string, userIDs, userID2s, mobiles []string, offset, pageSize int) (userList []*model.User, totalCount int, err error) {
offset = jxutils.FormalizePageOffset(offset)
pageSize = jxutils.FormalizePageSize(pageSize)
if userType == 0 {
@@ -84,6 +84,10 @@ func GetUsers(db *DaoDB, userType int, keyword string, userIDs, userID2s, mobile
sql += " AND t1.mobile IN (" + GenQuestionMarks(len(mobiles)) + ")"
sqlParams = append(sqlParams, mobiles)
}
if popUser != "" {
sql += " AND t1.pop_user = ?"
sqlParams = append(sqlParams, popUser)
}
if keyword != "" {
keywordLike := "%" + keyword + "%"
sql += " AND (t1.user_id LIKE ? OR t1.user_id2 LIKE ? OR t1.mobile LIKE ? OR t1.email LIKE ? OR t1.name LIKE ?)"