This commit is contained in:
苏尹岚
2021-04-02 15:56:59 +08:00
parent 91930ee307
commit e66e0d68d7
6 changed files with 19 additions and 19 deletions

View File

@@ -27,7 +27,7 @@ func GetAuthBind(db *DaoDB, bindType int, authType, authID string) (authBind *mo
return authBind, err
}
func GetUserBindAuthInfo(db *DaoDB, userID string, bindType int, typeList []string, authID, authID2, typeID string) (authList []*model.AuthBind, err error) {
func GetUserBindAuthInfo(db *DaoDB, userID string, bindType int, typeList []string, authID, authID2 string, typeIDs []string) (authList []*model.AuthBind, err error) {
sql := `
SELECT *
FROM auth_bind t1
@@ -56,9 +56,9 @@ func GetUserBindAuthInfo(db *DaoDB, userID string, bindType int, typeList []stri
sql += " AND t1.auth_id2 = ?"
sqlParams = append(sqlParams, authID2)
}
if typeID != "" {
sql += " AND t1.type_id = ?"
sqlParams = append(sqlParams, typeID)
if len(typeIDs) > 0 {
sql += " AND t1.type IN (" + GenQuestionMarks(len(typeIDs)) + ")"
sqlParams = append(sqlParams, typeIDs)
}
sql += " ORDER BY t1.type"
err = GetRows(db, &authList, sql, sqlParams...)