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

interface

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