Explorar o código

短剧点击人数统计

liuzejian hai 1 ano
pai
achega
8ee972bb23
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      app/Console/Commands/Stats/MiniprogramStats.php

+ 7 - 2
app/Console/Commands/Stats/MiniprogramStats.php

@@ -16,7 +16,7 @@ class MiniprogramStats extends Command{
      *
      * @var string
      */
-    protected $signature = 'Stats:MiniprogramStats';
+    protected $signature = 'Stats:MiniprogramStats {--day= : 日期}';
 
     /**
      * The console command description.
@@ -31,7 +31,12 @@ class MiniprogramStats extends Command{
      * Execute the console command.
      */
     public function handle(){
-        $this->day = date('Y-m-d',time()-86400);
+        $day = $this->option('day');
+        if($day) {
+            $this->day = $day;
+        } else {
+            $this->day = date('Y-m-d',time()-86400);
+        }
         $this->processUser();
         $this->processCompany();
     }