This commit is contained in:
richboo111
2022-08-10 14:58:56 +08:00
parent 5ad7351b75
commit 68530da1db

View File

@@ -48,14 +48,18 @@ func GetUserBindAuthInfo(db *DaoDB, userID string, bindType int, typeList []stri
sql += " AND t1.type IN (" + GenQuestionMarks(len(typeList)) + ")"
sqlParams = append(sqlParams, typeList)
}
if authID != "" {
sql += " AND t1.auth_id = ?"
sqlParams = append(sqlParams, authID)
}
if authID2 != "" {
sql += " OR t1.auth_id2 = ?"
sqlParams = append(sqlParams, authID2)
if authID != "" && authID2 != "" {
sql += "AND (t1.auth_id = ? OR t1.auth_id2 = ?)"
sqlParams = append(sqlParams, authID, authID2)
}
//if authID != "" {
// sql += " AND t1.auth_id = ?"
// sqlParams = append(sqlParams, authID)
//}
//if authID2 != "" {
// sql += " AND t1.auth_id2 = ?"
// sqlParams = append(sqlParams, authID2)
//}
if len(typeIDs) > 0 {
sql += " AND t1.type_id IN (" + GenQuestionMarks(len(typeIDs)) + ")"
sqlParams = append(sqlParams, typeIDs)