get()->goCheck('list'); return $this->dataLists(new AgriculturalMachineryCategoryLists()); } /** * @notes 添加资讯分类 * @return \think\response\Json * @author heshihu * @date 2022/2/21 17:31 */ public function add() { $params = (new AgriculturalMachineryServiceCategoryValidate())->post()->goCheck('add'); AgriculturalMachineryServiceCategoryLogic::add($params); return $this->success('添加成功', [], 1, 1); } /** * @notes 编辑农耕分类 * @return \think\response\Json * @author heshihu * @date 2022/2/21 17:49 */ public function edit() { $params = (new AgriculturalMachineryServiceCategoryValidate())->post()->goCheck('edit'); $result = AgriculturalMachineryServiceCategoryLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(AgriculturalMachineryServiceCategoryLogic::getError()); } /** * @notes 删除农耕分类 * @return \think\response\Json * @author heshihu * @date 2022/2/21 17:52 */ public function delete() { $params = (new AgriculturalMachineryServiceCategoryValidate())->post()->goCheck('delete'); AgriculturalMachineryServiceCategoryLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 农耕分类详情 * @return \think\response\Json * @author heshihu * @date 2022/2/21 17:54 */ public function detail() { $params = (new AgriculturalMachineryServiceCategoryValidate())->goCheck('detail'); $result = AgriculturalMachineryServiceCategoryLogic::detail($params); return $this->data($result); } /** * @notes 更改农耕分类状态 * @return \think\response\Json * @author heshihu * @date 2022/2/21 10:15 */ public function updateStatus() { $params = (new AgriculturalMachineryServiceCategoryValidate())->post()->goCheck('status'); $result = AgriculturalMachineryServiceCategoryLogic::updateStatus($params); if (true === $result) { return $this->success('修改成功', [], 1, 1); } return $this->fail(AgriculturalMachineryServiceCategoryLogic::getError()); } /** * @notes 获取有效农耕分类 * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2022/10/13 10:54 */ public function getValidCate() { $params = (new AgriculturalMachineryServiceCategoryValidate())->get()->goCheck('list'); $result = AgriculturalMachineryServiceCategoryLogic::getValidCateData($params); return $this->data($result); } /** * @notes 获取服务列表 * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2022/10/13 10:54 */ public function getUserServiceList() { $params = (new UserServiceValidate())->get()->goCheck('user_service'); $result = AgriculturalMachineryServiceCategoryLogic::getValidCateData($params); return $this->data($result); } }