request->params([ [ "nav_title", "" ], ]); return success(( new NavService() )->getPage($data)); } /** * 获取首页导航列表 * @return \think\Response */ public function lists() { $data = $this->request->params([ [ "nav_title", "" ] ]); return success(( new NavService() )->getList($data)); } /** * 首页导航详情 * @param int $id * @return \think\Response */ public function info(int $id) { return success(( new NavService() )->getInfo($id)); } /** * 添加首页导航 * @return \think\Response */ public function add() { $data = $this->request->params([ [ "nav_title", "" ], [ "nav_url", "" ], [ "sort", "" ], [ "is_blank", "" ], [ "nav_icon", "" ], [ "is_show", "" ], ]); $id = ( new NavService() )->add($data); return success('ADD_SUCCESS', [ 'id' => $id ]); } /** * 首页导航编辑 * @param $id 首页导航id * @return \think\Response */ public function edit($id) { $data = $this->request->params([ [ "nav_title", "" ], [ "nav_url", "" ], [ "sort", "" ], [ "is_blank", "" ], [ "nav_icon", "" ], [ "is_show", "" ], ]); ( new NavService() )->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 首页导航删除 * @param int $id 首页导航id * @return Response */ public function del(int $id) { ( new NavService() )->del($id); return success('DELETE_SUCCESS'); } }