From 35117dc93bcb770fc7f7e38cc16754ad96f39744 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Fri, 28 Nov 2025 14:29:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=94=B6=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/PostFavoriteService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/service/PostFavoriteService.php b/app/common/service/PostFavoriteService.php index 492f3d8..996585d 100644 --- a/app/common/service/PostFavoriteService.php +++ b/app/common/service/PostFavoriteService.php @@ -127,7 +127,7 @@ class PostFavoriteService $count = PostFavorite::where($where)->delete(); if ($count) { - $post = PostFavorite::where(['id' => $param['post_id']])->first(); + $post = Post::where(['id' => $param['post_id']])->first(); $post['favorite'] = $post['favorite']-1; $post['favorite'] = $post['favorite']<0?0:$post['favorite']; $post->save();