邀请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 ?)"

View File

@@ -56,8 +56,11 @@ type User struct {
LastLoginAt *time.Time `orm:"null" json:"lastLoginAt"`
LastLoginIP string `orm:"size(64);column(last_login_ip)" json:"lastLoginIP"`
LastLoginType string `orm:"size(16)" json:"lastLoginType"`
PopCode string `json:"popCode"` //推广码
PopUser string `json:"popUser"` //推广人
PopCode string `json:"popCode"` //推广码
PopUser string `json:"popUser"` //推广人
PopCount int `json:"popCount"` //推荐人数
PopFlag int `json:"popFlag"` //是否已通过推荐获得免费会员
PopedFlag int `json:"popedFlag"` //被邀请标志(弹框)
}
func (*User) TableUnique() [][]string {