gq 7 tahun lalu
induk
melakukan
ce29536da6
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      server/app/Http/Controllers/Api/V1/IndexController.php

+ 3 - 3
server/app/Http/Controllers/Api/V1/IndexController.php

xqd xqd
@@ -112,9 +112,9 @@ class IndexController extends Controller
     {
         $login_user = $this->getUser();
         $id = $login_user->id;
-        $arr1 =DreamInfoModel::orderBy('score','desc')->limit(20)->select('id')->get()->toArray();
+        $arr1 =DreamInfoModel::orderBy('score','desc')->limit(30)->select('id')->get()->toArray();
         $id_arr1 = array_column($arr1,'id');
-        $arr2 =DreamInfoModel::orderBy('score','desc')->offset(20)->limit(120)->select('id')->get()->toArray();
+        $arr2 =DreamInfoModel::orderBy('score','desc')->offset(15)->limit(120)->select('id')->get()->toArray();
         $id_arr2 = array_column($arr2,'id');
         $dtusers =UserCareUser::where('user_id',$id)->with('other_user')->
         where('dream_number','>',0)->orderBy('created_at')->get()->toArray();
@@ -140,7 +140,7 @@ class IndexController extends Controller
             return $this->api(compact('users','dreams'));
         } else{
             $banners = $this->getBanner();
-            $dreams = DreamInfoModel::orderBy('score','desc')->with('user')->limit(20)->paginate(20);
+            $dreams = DreamInfoModel::orderBy('score','desc')->with('user')->limit(15)->paginate(15);
             $this->dreams($dreams);
             return $this->api(compact('banners','users','dreams'));
         }