From bf4bb399e833ab22b989f9a317c9821f4337762c Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Tue, 23 Jan 2024 18:12:59 +0800 Subject: [PATCH] add --- admin/src/views/device/edit.vue | 4 ++++ app/api/controller/FarmController.php | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/admin/src/views/device/edit.vue b/admin/src/views/device/edit.vue index 14a0e6f..138d1a1 100644 --- a/admin/src/views/device/edit.vue +++ b/admin/src/views/device/edit.vue @@ -43,6 +43,9 @@ + + + order('create_time desc')->select()->toArray(); return $this->success('请求成功',$data); } + + public function add() + { + $params = (new FarmValidate())->post()->goCheck('add'); + $result = FarmLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(FarmLogic::getError()); + } + + } \ No newline at end of file