shish 5 ani în urmă
părinte
comite
1e1f6c3ac7
1 a modificat fișierele cu 8 adăugiri și 0 ștergeri
  1. 8 0
      app-pt/controllers/GhsController.php

+ 8 - 0
app-pt/controllers/GhsController.php

@@ -32,12 +32,20 @@ class GhsController extends BaseController
         if (isset($ghsSj['style']) == false || $ghsSj['style'] != SjClass::STYLE_KM_SUPPLIER) {
             util::fail('请选择昆明供货商');
         }
+        $count = ShopClass::getCount(['delStatus' => 0, 'merchantId' => $sjId]);
+        if ($count > 1) {
+            util::fail('发起人已经不止一家门店,不能再进行绑定');
+        }
         $shop = ShopClass::getByCondition(['delStatus' => 0, 'merchantId' => $sjId]);
         if (empty($shop)) {
             util::fail('没有找到门店');
         }
         $shopId = $shop['id'] ?? 0;
 
+        $count = ShopClass::getCount(['delStatus' => 0, 'merchantId' => $ghsSjId]);
+        if ($count > 1) {
+            util::fail('供货商已经不止一家门店,不能再进行绑定');
+        }
         $ghsShop = ShopClass::getByCondition(['delStatus' => 0, 'merchantId' => $ghsSjId]);
         if (empty($ghsShop)) {
             util::fail('没有找到门店');