From be22558864789181f961a254afd0b234efca51a4 Mon Sep 17 00:00:00 2001 From: zhuchunshu Date: Sun, 23 Jun 2024 16:03:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Plugins/Topic/src/Handler/Topic/ShowTopic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Plugins/Topic/src/Handler/Topic/ShowTopic.php b/app/Plugins/Topic/src/Handler/Topic/ShowTopic.php index 550bf4ef9..d213b9d82 100644 --- a/app/Plugins/Topic/src/Handler/Topic/ShowTopic.php +++ b/app/Plugins/Topic/src/Handler/Topic/ShowTopic.php @@ -13,6 +13,7 @@ use App\Plugins\Comment\src\Model\TopicComment; use App\Plugins\Core\src\Models\Report; use App\Plugins\Topic\src\Models\Topic; +use App\Plugins\Topic\src\Models\TopicUnlock; use Hyperf\DbConnection\Db; class ShowTopic { @@ -29,7 +30,7 @@ public function handle($id, $comment_page) // 帖子发布天数 $post_published_time = floor((time() - strtotime((string) $topic->created_at)) / 86400); // 判断是否需要锁帖 - if ($topic->status !== 'lock' && get_options('topic_auto_lock') === 'true' && (int) $post_published_time > (int) get_options('topic_auto_lock_day', 30)) { + if ($topic->status !== 'lock' && get_options('topic_auto_lock') === 'true' && (int) $post_published_time > (int) get_options('topic_auto_lock_day', 30) && !TopicUnlock::where('topic_id',$topic->id)->exists()) { // 锁帖 Db::table('topic')->where('id', $id)->update(['status' => 'lock']); // 发送通知