diff --git a/business/model/dao/dao_auth2.go b/business/model/dao/dao_auth2.go index 34cbe095f..5eda1df1b 100644 --- a/business/model/dao/dao_auth2.go +++ b/business/model/dao/dao_auth2.go @@ -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)