jauhar54 2 лет назад
Родитель
Сommit
6ab8a90006
1 измененных файлов: 3 добавлений и 3 удалений
  1. 3
    3
      app/Http/Controllers/Api/V1/PointLogController.php

+ 3
- 3
app/Http/Controllers/Api/V1/PointLogController.php Просмотреть файл

@@ -22,7 +22,7 @@ class PointLogController extends Controller
22 22
 
23 23
     public function getAll()
24 24
     {
25
-        $query = User::select('users.name', 'users.id as user_id', DB::raw('SUM(point_logs.point) as total_point'))->rightJoin('point_logs', 'point_logs.user_id', 'users.id')->groupBy('point_logs.user_id')->orderBy('total_point', 'desc')->limit(5)->get();
25
+        $query = User::select('users.name', 'users.id as user_id', DB::raw('SUM(point_logs.point) as total_point'))->rightJoin('point_logs', 'point_logs.user_id', 'users.id')->groupBy('point_logs.user_id')->orderBy('total_point', 'desc')->limit(10)->get();
26 26
 
27 27
         if($query){
28 28
             $result = $query;
@@ -45,7 +45,7 @@ class PointLogController extends Controller
45 45
     
46 46
     public function getNonEvent()
47 47
     {
48
-        $query = User::select('users.name', 'users.id as user_id', DB::raw('SUM(point_logs.point) as total_point'))->rightJoin('point_logs', 'point_logs.user_id', 'users.id')->where('event_id', '=', 0)->groupBy('point_logs.user_id')->orderBy('total_point', 'desc')->limit(5)->get();
48
+        $query = User::select('users.name', 'users.id as user_id', DB::raw('SUM(point_logs.point) as total_point'))->rightJoin('point_logs', 'point_logs.user_id', 'users.id')->where('event_id', '=', 0)->groupBy('point_logs.user_id')->orderBy('total_point', 'desc')->limit(10)->get();
49 49
 
50 50
         if($query){
51 51
             $result = $query;
@@ -68,7 +68,7 @@ class PointLogController extends Controller
68 68
 
69 69
     public function getWithEvent()
70 70
     {
71
-        $query = User::select('users.name', 'users.id as user_id', DB::raw('SUM(point_logs.point) as total_point'))->rightJoin('point_logs', 'point_logs.user_id', 'users.id')->where('event_id', '=', 1)->groupBy('point_logs.user_id')->orderBy('total_point', 'desc')->limit(5)->get();
71
+        $query = User::select('users.name', 'users.id as user_id', DB::raw('SUM(point_logs.point) as total_point'))->rightJoin('point_logs', 'point_logs.user_id', 'users.id')->where('event_id', '=', 1)->groupBy('point_logs.user_id')->orderBy('total_point', 'desc')->limit(10)->get();
72 72
 
73 73
         if($query){
74 74
             $result = $query;

Загрузка…
Отмена
Сохранить