xielin преди 5 години
родител
ревизия
5e2c53792d
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      app/Console/Commands/PostStatistics.php

+ 3 - 3
app/Console/Commands/PostStatistics.php

@@ -75,7 +75,7 @@ class PostStatistics extends Command
             ->where([['created_at', '>=', $yesterdayStart], ['created_at', '<=', $yesterdayEnd]])
             ->select(DB::raw('count(*) as comment_count'))
             ->first();
-        $behaviors = $this->behavior->whereIn('behavior_identification', ['read', 'like', 'share', 'collect'])->get()->toArray();
+        $behaviors = $this->behavior->whereIn('behavior_identification', ['read', 'like', 'forward', 'collect'])->get()->toArray();
         $postCount = $post->post_count;
         $commentCount = $comment->comment_count;
         $readCount = 0;
@@ -126,8 +126,8 @@ class PostStatistics extends Command
             if(isset($logContent['add_collect_count']) && $logContent['add_collect_count']){
                 $collectCount -= $logContent['add_collect_count'];
             }
-            if(isset($logContent['add_collect_count']) && $logContent['add_collect_count']){
-                $shareCount -= $logContent['add_collect_count'];
+            if(isset($logContent['add_share_count']) && $logContent['add_share_count']){
+                $shareCount -= $logContent['add_share_count'];
             }
         }
         $data['post_count'] = $postCount;