From 10a04f15f013b426e0f444c7935437f690848078 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Tue, 30 Jan 2024 09:11:31 +0800 Subject: [PATCH] add --- app/api/controller/FenceHouseController.php | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/api/controller/FenceHouseController.php b/app/api/controller/FenceHouseController.php index cf182a5..dd6a3bf 100644 --- a/app/api/controller/FenceHouseController.php +++ b/app/api/controller/FenceHouseController.php @@ -5,6 +5,7 @@ namespace app\api\controller; use app\adminapi\logic\fence_house\FenceHouseLogic; use app\adminapi\validate\fence_house\FenceHouseValidate; use app\api\lists\FenceHouseLists; +use think\facade\Db; use think\response\Json; class FenceHouseController extends BaseApiController @@ -56,4 +57,25 @@ class FenceHouseController extends BaseApiController $datas = (new FenceHouseLogic())->datas($params); return $this->data($datas); } + + // 离栏操作 + public function leave() + { + $params = $this->request->param(); + $params['create_time'] = time(); + $params['update_time'] = time(); + Db::name('leave_fence_house_log')->insert($params); + return $this->success('离栏成功'); + } + + // 换栏操作 + public function exchange() + { + $params = $this->request->param(); + $params['create_time'] = time(); + $params['update_time'] = time(); + Db::name('change_fence_house_log')->insert($params); + return $this->success('换栏成功'); + } + } \ No newline at end of file