From 30bbd9896021f226f62dac9c878f462a10bae8b5 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 4 Sep 2023 17:47:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AF=A6=E6=83=85=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/community/CommunityRepository.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/common/repositories/community/CommunityRepository.php b/app/common/repositories/community/CommunityRepository.php index 305375f6..4cf7a61d 100644 --- a/app/common/repositories/community/CommunityRepository.php +++ b/app/common/repositories/community/CommunityRepository.php @@ -327,6 +327,12 @@ class CommunityRepository extends BaseRepository $data['care_count'] = $merInfo['care_count']; } } + if ($data['is_type'] == 2) { + $prevId = Db::name('community')->where('community_id', '<', $id)->where('is_type', 2)->order('community_id', 'desc')->value('community_id', 0); + $nextId = Db::name('community')->where('community_id', '>', $id)->where('is_type', 2)->order('community_id', 'asc')->value('community_id', 0); + $data['prev_id'] = $prevId; + $data['next_id'] = $nextId; + } return $data; }