Skip to content

Commit

Permalink
fix:修复已知bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuchunshu committed Jun 23, 2024
1 parent 919a2af commit be22558
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Plugins/Topic/src/Handler/Topic/ShowTopic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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']);
// 发送通知
Expand Down

0 comments on commit be22558

Please sign in to comment.