shish 3 лет назад
Родитель
Сommit
8b4cb68984
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      app-ghs/controllers/CustomController.php

+ 8 - 2
app-ghs/controllers/CustomController.php

@@ -285,13 +285,19 @@ class CustomController extends BaseController
         if (empty($fromShop)) {
             util::fail('门店不存在');
         }
+        $fromShopName = $fromShop->shopName ?? '';
+        if ($fromShop->syncCustom == 0) {
+            util::fail('不允许从' . $fromShopName . '同步客户');
+        }
         $toShopId = $this->shopId;
-
         if ($fromShopId == $toShopId) {
             util::fail('本店无需同步');
         }
-
         $toShop = $this->shop;
+        $toShopName = $toShop->shopName ?? '';
+        if ($toShop->syncCustom == 0) {
+            util::fail($toShopName . '已关闭同步功能');
+        }
         $toSjId = $toShop->sjId ?? 0;
         $fromSjId = $fromShop->sjId ?? 0;
         if ($toSjId != $fromSjId) {