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

interface

@@ -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);