Explorar el Código

Merge pull request #1053 from visuddhinanda/laravel

add count of editor
visuddhinanda hace 3 años
padre
commit
d2a190f6e7
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6 2
      app/Console/Commands/StatisticsNissaya.php

+ 6 - 2
app/Console/Commands/StatisticsNissaya.php

@@ -57,8 +57,12 @@ class StatisticsNissaya extends Command
             $strlen = Sentence::whereIn('channel_uid',$channels)
                     ->whereDate('created_at','=',$date)
                     ->sum('strlen');
-            $this->info($date.','.$strlen);
-            Storage::disk('local')->append($file, $date.','.$strlen);
+            $editor = Sentence::whereIn('channel_uid',$channels)
+                    ->whereDate('created_at','=',$date)
+                    ->groupBy('editor_uid')
+                    ->select('editor_uid')->get();
+            $this->info($date.','.$strlen.','.count($editor));
+            Storage::disk('local')->append($file, $date.','.$strlen.','.count($editor));
         }
         return 0;
     }