xielin před 5 roky
rodič
revize
9244b87f55

+ 1 - 0
app/Console/Commands/CalcPostWeight.php

@@ -45,6 +45,7 @@ class CalcPostWeight extends Command
         $this->line('开始计算权重');
         $key = "community_calc_post_score";
         $postIds = Redis::smembers($key);
+        Log::debug('权重帖子ID:'.json_encode($postIds));
         foreach ($postIds as $postId) {
             $postInfo = PostData::where("post_id", $postId)->first();
             $temp = $postInfo['pv'] +

+ 2 - 0
app/Repositories/PostRepositories.php

@@ -391,6 +391,7 @@ class PostRepositories
                 Log::debug("帖子:".$postId."被取消收藏,collect_count -1");
             }
         }
+        $this->collectPostId($request['post_id']);
         return $post->save();
     }
 
@@ -403,6 +404,7 @@ class PostRepositories
     {
         $key = "community_calc_post_score";
         Redis::sadd($key,$id);
+        Log::debug('存入帖子'.$id.'到权重列表');
     }