zqbao пре 8 месеци
родитељ
комит
7ca93b16a7
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      models/user.go

+ 2 - 1
models/user.go

@@ -333,7 +333,8 @@ func GetGlobalUserByCondition(userIds []int, sortCondition string, startSize, pa
 	sql := `SELECT u.*, COUNT(ur.user_id) AS read_cnt, MAX(ur.create_time) AS last_update_time
 	FROM user AS u
 	LEFT JOIN user_read_record AS ur
-	ON u.user_id = ur.user_id AND ur.user_id IN (` + utils.GetOrmReplaceHolder(len(userIds)) + `)
+	ON u.user_id = ur.user_id 
+	WHERE u.user_id IN (` + utils.GetOrmReplaceHolder(len(userIds)) + `)
 	GROUP BY u.user_id ` + sortCondition + ` LIMIT ?,? `
 	_, err = o.Raw(sql, userIds, startSize, pageSize).QueryRows(&items)
 	return