正在显示
1 个修改的文件
包含
6 行增加
和
0 行删除
@@ -164,6 +164,12 @@ class AdminEquipmentController extends AdminBaseController{ | @@ -164,6 +164,12 @@ class AdminEquipmentController extends AdminBaseController{ | ||
164 | 'create_time' => time() | 164 | 'create_time' => time() |
165 | ]; | 165 | ]; |
166 | $data['qr_code'] = $this->createQrCode($data['name']); | 166 | $data['qr_code'] = $this->createQrCode($data['name']); |
167 | + //查询设备是否已存在 | ||
168 | + $is_equipment=Db::name('equipment')->where(['name'=>$data['name'],'is_delete'=>0])->count(); | ||
169 | + if (!empty($is_equipment)){ | ||
170 | + echo "第" . $j . "行".$data['name']."的设备已存在!<br/>"; | ||
171 | + continue; | ||
172 | + } | ||
167 | $Equipment=new EquipmentModel(); | 173 | $Equipment=new EquipmentModel(); |
168 | try{ | 174 | try{ |
169 | $Equipment->save($data); | 175 | $Equipment->save($data); |
-
请 注册 或 登录 后发表评论