dataLists(new DishesCategoryLists()); } /** * @notes 添加 * @return \think\response\Json * @author likeadmin * @date 2025/07/11 11:41 */ public function add() { $params = (new DishesCategoryValidate())->post()->goCheck('add'); $result = DishesCategoryLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(DishesCategoryLogic::getError()); } /** * @notes 编辑 * @return \think\response\Json * @author likeadmin * @date 2025/07/11 11:41 */ public function edit() { $params = (new DishesCategoryValidate())->post()->goCheck('edit'); $result = DishesCategoryLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(DishesCategoryLogic::getError()); } /** * @notes 删除 * @return \think\response\Json * @author likeadmin * @date 2025/07/11 11:41 */ public function delete() { $params = (new DishesCategoryValidate())->post()->goCheck('delete'); DishesCategoryLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取详情 * @return \think\response\Json * @author likeadmin * @date 2025/07/11 11:41 */ public function detail() { $params = (new DishesCategoryValidate())->goCheck('detail'); $result = DishesCategoryLogic::detail($params); return $this->data($result); } public function all(Request $request) { $params = $request->get(); $result = DishesCategoryLogic::all($params); return $this->data($result); } }