This commit is contained in:
chenbo 2024-01-25 09:20:39 +08:00
parent bf4bb399e8
commit 57218d13f8
2 changed files with 2 additions and 0 deletions

View File

@ -41,6 +41,7 @@ class FarmLogic extends BaseLogic
Db::startTrans(); Db::startTrans();
try { try {
Farm::create([ Farm::create([
'user_id' => $params['user_id'],
'farm_name' => $params['farm_name'], 'farm_name' => $params['farm_name'],
'farm_type' => $params['farm_type'], 'farm_type' => $params['farm_type'],
'breed_type' => $params['breed_type'], 'breed_type' => $params['breed_type'],

View File

@ -20,6 +20,7 @@ class FarmController extends BaseApiController
public function add() public function add()
{ {
$params = (new FarmValidate())->post()->goCheck('add'); $params = (new FarmValidate())->post()->goCheck('add');
$params['user_id'] = $this->userId;
$result = FarmLogic::add($params); $result = FarmLogic::add($params);
if (true === $result) { if (true === $result) {
return $this->success('添加成功', [], 1, 1); return $this->success('添加成功', [], 1, 1);