作者 董瑞恩
1 个管道 的构建 通过 耗费 0 秒

interface

... ... @@ -75,6 +75,10 @@ class AdminEquipmentController extends AdminBaseController{
$data=$this->request->post();
$data['create_time']=strtotime($data['create_time']);
$data['qr_code'] = $this->createQrCode($data['name']);
$is_equipment=Db::name('equipment')->where(['name'=>$data['name'],'is_delete'=>0])->count();
if (!empty($is_equipment)){
$this->apiResponse(302,'设备已存在');
}
$Equipment=new EquipmentModel();
$res=$Equipment->save($data);
if ($res){
... ...