wesmiler 6 år sedan
förälder
incheckning
eb3cfc71bc
1 ändrade filer med 9 tillägg och 0 borttagningar
  1. 9 0
      vendor/thinkcmf/cmf-app/src/admin/controller/ShopController.php

+ 9 - 0
vendor/thinkcmf/cmf-app/src/admin/controller/ShopController.php

@@ -1042,6 +1042,15 @@ class ShopController extends AdminBaseController
         if(empty($info)){
             $this->error('操作数据不存在!');
         }
+
+        // 验证商家是否有设备
+        $checkDevice = Devices::where('status','in',[1,2])
+            ->where('shop_uid','in', $userIds)
+            ->count('id');
+        if($checkDevice){
+            $this->error('该商家存在设备请先删除打印设备!');
+        }
+
 //        $userIds = Db::name('shop')->where(['user_id' => ['in'=> $id]])->column('user_id');
         Db::startTrans();
         if (Db::name('shop')->where(['user_id' => ['in'=>$userIds]])->delete()) {