_valid([ "category.default" => 0, "size.default" => 10, "page.default" => 1, ],$request->method()); $banner = (new BlueBanner)->where("status",1)->field("title,img,path")->select()->toArray(); $category = (new BlueCategory)->where("type",1)->field("name,icon,small_icon,sign")->append(['id'])->withAttr(['id' => function($data,$resp){ return $resp['sign']; }])->select()->toArray(); if (empty($param['category']) || $param['category'] == 0) { $param['category'] = $category[0]['id']; } $share = [ "image" => sConf("wechat.share"), "title" => sConf("wechat.share_title") ]; $rank = []; $star = (new BlueExpertPlatform)->order("create_at","desc")->field("source,nickname,avatar,follower_count,create_at")->limit(10)->select()->toArray(); $list = $this->service->getHomeList(['category' => $param['category'],'pageSize' => $param['size'],'page' => $param['page']]); $task = pageFormat($list); return success("ok",compact("banner","category",'task','share','rank','star')); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }