From 8dc9cb8f02b0259301a8305975307c62650aaba2 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Tue, 15 Aug 2023 03:35:13 +0800 Subject: [PATCH] fix bookmark --- app/Repositories/ClaimRepository.php | 3 ++- include/constants.php | 2 +- public/torrents.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) 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)