wzq 5 gadi atpakaļ
vecāks
revīzija
922a4950b3

+ 4 - 4
app/Console/Commands/TopicUseCount.php

@@ -21,7 +21,7 @@ class TopicUseCount extends Command
      *
      * @var string
      */
-    protected $description = '更新话题使用数';
+    protected $description = '添加话题使用数';
 
     /**
      * Create a new command instance.
@@ -41,7 +41,7 @@ class TopicUseCount extends Command
      */
     public function handle()
     {
-        $this->line("开始更新话题使用数");
+        $this->line("开始添加话题使用数");
 
         $key = 'topic.just_use_count';
         $ids = Redis::ZRANGE($key, 0 , -1, 'WITHSCORES');
@@ -50,9 +50,9 @@ class TopicUseCount extends Command
                 $value = Redis::ZSCORE($key, $topicId);
                 Redis::ZREM ($key, $topicId);
                 $this->topic->where('id', $topicId)->increment('use_count', $value);
-                Log::debug('更新更新话题使用数成功'.$topicId.'-'.$value);
+                Log::debug('添加话题使用数成功'.$topicId.'-'.$value);
             }catch (\Exception $exception){
-                Log::error('更新更新话题使用数失败'.$topicId.'-'.$val.$exception->getMessage());
+                Log::error('添加话题使用数失败'.$topicId.'-'.$val.$exception->getMessage());
             }
             usleep(10000);
         }

+ 1 - 5
app/Console/Commands/UpdateTopicUseCount.php

@@ -9,12 +9,8 @@ namespace App\Console\Commands;
 
 
 use App\Models\Post;
-use App\Models\PostCollect;
-use App\Models\PostDislike;
-use App\Models\PostLike;
 use App\Models\Topic;
 use Illuminate\Console\Command;
-use Illuminate\Support\Facades\Redis;
 
 class UpdateTopicUseCount extends Command
 {
@@ -23,7 +19,7 @@ class UpdateTopicUseCount extends Command
      *
      * @var string
      */
-    protected $signature = 'post:topic_use_count';
+    protected $signature = 'post:update_topic_use_count';
 
     /**
      * The console command description.