add
This commit is contained in:
parent
9f475b8b70
commit
bf4bb399e8
|
@ -43,6 +43,9 @@
|
|||
<el-form-item label="设备编码" prop="code">
|
||||
<el-input v-model="formData.code" clearable placeholder="请输入设备编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="硬件ICCID" prop="iccid">
|
||||
<el-input v-model="formData.iccid" clearable placeholder="请输入ICCID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备图" prop="image">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
|
@ -150,6 +153,7 @@ const formData = reactive({
|
|||
id: '',
|
||||
product_id: '',
|
||||
code: '',
|
||||
iccid: '',
|
||||
name: '',
|
||||
video_url: '',
|
||||
type: '',
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\adminapi\logic\farm\FarmLogic;
|
||||
use app\adminapi\validate\farm\FarmValidate;
|
||||
use app\common\model\farm\Farm;
|
||||
|
||||
class FarmController extends BaseApiController
|
||||
|
@ -14,4 +16,16 @@ class FarmController extends BaseApiController
|
|||
$data = Farm::where($where)->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());
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue