service = new MusicService(); $this->cateService = new MusicSheetsService(); } /** * 列表 * @return array */ public function index(){ $params = request()->all(); $type = request()->get('type', 1); return $this->service->getDataList($params); } /** * 详情 * @return array|mixed */ public function detail(){ $id = request()->get('id',0); if($id<=0){ return message(1006, false); } $this->service->updateVisit($this->userId); $info = $this->service->getDetail($id, $this->userId); return message(1005, true, $info); } /** * 获取分类 * @return mixed */ public function cates(){ return $this->cateService->getOptions(); } }