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();