正在显示
1 个修改的文件
包含
4 行增加
和
0 行删除
@@ -75,6 +75,10 @@ class AdminEquipmentController extends AdminBaseController{ | @@ -75,6 +75,10 @@ class AdminEquipmentController extends AdminBaseController{ | ||
75 | $data=$this->request->post(); | 75 | $data=$this->request->post(); |
76 | $data['create_time']=strtotime($data['create_time']); | 76 | $data['create_time']=strtotime($data['create_time']); |
77 | $data['qr_code'] = $this->createQrCode($data['name']); | 77 | $data['qr_code'] = $this->createQrCode($data['name']); |
78 | + $is_equipment=Db::name('equipment')->where(['name'=>$data['name'],'is_delete'=>0])->count(); | ||
79 | + if (!empty($is_equipment)){ | ||
80 | + $this->apiResponse(302,'设备已存在'); | ||
81 | + } | ||
78 | $Equipment=new EquipmentModel(); | 82 | $Equipment=new EquipmentModel(); |
79 | $res=$Equipment->save($data); | 83 | $res=$Equipment->save($data); |
80 | if ($res){ | 84 | if ($res){ |
-
请 注册 或 登录 后发表评论