duqinya 5 anos atrás
pai
commit
48005a4d00
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      app/Console/Commands/RankingList.php

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

@@ -58,9 +58,9 @@ class RankingList extends Command
     {
         $yesterday_start = Carbon::now()->addDays(-1)->startOfDay()->toDateTimeString();
         $yesterday_end = Carbon::now()->addDays(-1)->endOfDay()->toDateTimeString();
-        return $model->select(DB::raw('count(*) as num'), 'generation_quantity', 'content_author_id', DB::raw('sum(generation_quantity) as count'))
+        return $model->select(DB::raw('count(*) as num'),'content_author_id', DB::raw('sum(generation_quantity) as count'))
             ->whereBetween('created_at', [$yesterday_start, $yesterday_end])
-            ->groupBy('generation_quantity', 'content_author_id')
+            ->groupBy('content_author_id')
             ->orderBy('count', 'desc')
             ->limit(10)
             ->get();
@@ -97,8 +97,8 @@ class RankingList extends Command
         }
         $release_author = $this->releaseRecord
             ->whereBetween('created_at', [$yesterday_start, $yesterday_end])
-            ->select(DB::raw('count(*) as num'), 'generation_quantity', 'uid as content_author_id', DB::raw('sum(generation_quantity) as count'))
-            ->groupBy('generation_quantity', 'content_author_id')->orderBy('count', 'desc')->limit(10)->get();
+            ->select(DB::raw('count(*) as num'), 'uid as content_author_id', DB::raw('sum(generation_quantity) as count'))
+            ->groupBy('content_author_id')->orderBy('count', 'desc')->limit(10)->get();
 
         $release_best_author = $release_author->toArray();
         foreach ($release_best_author as $k => $v) {