|
@@ -112,9 +112,9 @@ class IndexController extends Controller
|
|
{
|
|
{
|
|
$login_user = $this->getUser();
|
|
$login_user = $this->getUser();
|
|
$id = $login_user->id;
|
|
$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');
|
|
$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');
|
|
$id_arr2 = array_column($arr2,'id');
|
|
$dtusers =UserCareUser::where('user_id',$id)->with('other_user')->
|
|
$dtusers =UserCareUser::where('user_id',$id)->with('other_user')->
|
|
where('dream_number','>',0)->orderBy('created_at')->get()->toArray();
|
|
where('dream_number','>',0)->orderBy('created_at')->get()->toArray();
|
|
@@ -135,12 +135,12 @@ class IndexController extends Controller
|
|
$this->dreams($dreams);
|
|
$this->dreams($dreams);
|
|
return $this->api(compact('users','dreams'));
|
|
return $this->api(compact('users','dreams'));
|
|
} elseif ($type == 'news') {
|
|
} elseif ($type == 'news') {
|
|
- $dreams = DreamInfoModel::orderBy('score','desc')->orderBy('created_at','desc')->with('user')->whereNotIn('id', $id_arr2)->limit(500)->toSql();
|
|
|
|
|
|
+ $dreams = DreamInfoModel::orderBy('score','desc')->orderBy('created_at','desc')->with('user')->whereNotIn('id', $id_arr2)->limit(500)->paginate(20);
|
|
$this->dreams($dreams);
|
|
$this->dreams($dreams);
|
|
return $this->api(compact('users','dreams'));
|
|
return $this->api(compact('users','dreams'));
|
|
} else{
|
|
} else{
|
|
$banners = $this->getBanner();
|
|
$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);
|
|
$this->dreams($dreams);
|
|
return $this->api(compact('banners','users','dreams'));
|
|
return $this->api(compact('banners','users','dreams'));
|
|
}
|
|
}
|