where('status',1) ->orderBy('sort') ->get(); return $this->success($all); } /** * 首页顶部分类 */ public function navBar() { $all = NavBar::select(['name','icon','type']) ->where('status',1) ->orderBy('sort') ->get(); return $this->success($all); } /** * 首页顶部分类 */ public function banner() { $all = Banner::select(['name as title','image','episode_id']) ->where('status',1) ->orderBy('sort') ->get(); return $this->success($all); } public function homeColumn() { $all = HomeColumn::select(['name','type']) ->where('status',1) ->orderBy('sort') ->get(); return $this->success($all); } public function rechargeCombo() { $lists = RechargeCombo::where('status', 1)->get()->toArray(); $vipCombo = VipCombo::select(['id','name','price','valid_day','desc']) ->where('status', 1) ->orderByDesc('valid_day') ->first()->toArray(); $vipCombo['vip_combo'] = 1; $offset = collect($lists)->count() > 6 ? 5 : collect($lists)->count(); array_splice($lists,$offset,1, [$vipCombo]); return $this->success($lists); } public function config() { $config = Setting::first(); return $this->success($config); } }