diff --git a/app/Repositories/ClaimRepository.php b/app/Repositories/ClaimRepository.php index b3040b26..c20bc054 100644 --- a/app/Repositories/ClaimRepository.php +++ b/app/Repositories/ClaimRepository.php @@ -304,8 +304,9 @@ class ClaimRepository extends BaseRepository ) { $now = Carbon::now(); $allTorrentIdArr = array_merge($reachedTorrentIdArr, $unReachedTorrentIdArr, $remainTorrentIdArr); + //这里不使用占位符,在 $allTorrentIdArr 过大(超过3000)时容易结果为空且不报异常 $torrentInfo = Torrent::query() - ->whereIn('id', $allTorrentIdArr) + ->whereRaw(sprintf("id in (%s)", implode(',', $allTorrentIdArr))) ->get(Torrent::$commentFields) ->keyBy('id') ; diff --git a/include/constants.php b/include/constants.php index 40757013..997c0e14 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ 1)