From 57218d13f84374436cc526c67f68d7f2afa240df Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 25 Jan 2024 09:20:39 +0800 Subject: [PATCH] update --- app/adminapi/logic/farm/FarmLogic.php | 1 + app/api/controller/FarmController.php | 1 + 2 files changed, 2 insertions(+) diff --git a/app/adminapi/logic/farm/FarmLogic.php b/app/adminapi/logic/farm/FarmLogic.php index 7bc4197..ed787e0 100644 --- a/app/adminapi/logic/farm/FarmLogic.php +++ b/app/adminapi/logic/farm/FarmLogic.php @@ -41,6 +41,7 @@ class FarmLogic extends BaseLogic Db::startTrans(); try { Farm::create([ + 'user_id' => $params['user_id'], 'farm_name' => $params['farm_name'], 'farm_type' => $params['farm_type'], 'breed_type' => $params['breed_type'], diff --git a/app/api/controller/FarmController.php b/app/api/controller/FarmController.php index 8522739..3b8236b 100644 --- a/app/api/controller/FarmController.php +++ b/app/api/controller/FarmController.php @@ -20,6 +20,7 @@ class FarmController extends BaseApiController public function add() { $params = (new FarmValidate())->post()->goCheck('add'); + $params['user_id'] = $this->userId; $result = FarmLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1);