- GetUsers添加userID参数

This commit is contained in:
gazebo
2019-08-06 11:15:32 +08:00
parent d0821c05b0
commit 88ebbbf9e7
3 changed files with 12 additions and 7 deletions

View File

@@ -23,7 +23,7 @@ func GetUserByID(db *DaoDB, fieldName, fieldValue string) (user *model.User, err
return user, err
}
func GetUsers(db *DaoDB, userType int, userID2, mobile, userName string) (userList []*model.User, err error) {
func GetUsers(db *DaoDB, userType int, userID, userID2, mobile, userName string) (userList []*model.User, err error) {
if userType == 0 {
userType = 255
}
@@ -35,6 +35,10 @@ func GetUsers(db *DaoDB, userType int, userID2, mobile, userName string) (userLi
utils.DefaultTimeValue,
userType,
}
if userID != "" {
sql += " AND t1.user_id = ?"
sqlParams = append(sqlParams, userID)
}
if userID2 != "" {
sql += " AND t1.user_id2 = ?"
sqlParams = append(sqlParams, userID2)