update
This commit is contained in:
parent
bf4bb399e8
commit
57218d13f8
|
@ -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'],
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue