shish 5 anni fa
parent
commit
1e1f6c3ac7
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  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) {
         if (isset($ghsSj['style']) == false || $ghsSj['style'] != SjClass::STYLE_KM_SUPPLIER) {
             util::fail('请选择昆明供货商');
             util::fail('请选择昆明供货商');
         }
         }
+        $count = ShopClass::getCount(['delStatus' => 0, 'merchantId' => $sjId]);
+        if ($count > 1) {
+            util::fail('发起人已经不止一家门店,不能再进行绑定');
+        }
         $shop = ShopClass::getByCondition(['delStatus' => 0, 'merchantId' => $sjId]);
         $shop = ShopClass::getByCondition(['delStatus' => 0, 'merchantId' => $sjId]);
         if (empty($shop)) {
         if (empty($shop)) {
             util::fail('没有找到门店');
             util::fail('没有找到门店');
         }
         }
         $shopId = $shop['id'] ?? 0;
         $shopId = $shop['id'] ?? 0;
 
 
+        $count = ShopClass::getCount(['delStatus' => 0, 'merchantId' => $ghsSjId]);
+        if ($count > 1) {
+            util::fail('供货商已经不止一家门店,不能再进行绑定');
+        }
         $ghsShop = ShopClass::getByCondition(['delStatus' => 0, 'merchantId' => $ghsSjId]);
         $ghsShop = ShopClass::getByCondition(['delStatus' => 0, 'merchantId' => $ghsSjId]);
         if (empty($ghsShop)) {
         if (empty($ghsShop)) {
             util::fail('没有找到门店');
             util::fail('没有找到门店');