shish 5 лет назад
Родитель
Сommit
ecbc7108af
1 измененных файлов с 9 добавлено и 5 удалено
  1. 9 5
      biz-ghs/custom/classes/CustomClass.php

+ 9 - 5
biz-ghs/custom/classes/CustomClass.php

@@ -48,15 +48,19 @@ class CustomClass extends BaseClass
                 if (empty($ghsShop)) {
                 if (empty($ghsShop)) {
                     util::fail('没有找到门店');
                     util::fail('没有找到门店');
                 }
                 }
-
                 $ghs = GhsClass::getByCondition(['ownSjId' => $sjId, 'sjId' => $ghsShop['merchantId'], 'shopId' => $ghsShop['id']]);
                 $ghs = GhsClass::getByCondition(['ownSjId' => $sjId, 'sjId' => $ghsShop['merchantId'], 'shopId' => $ghsShop['id']]);
                 if (empty($ghs)) {
                 if (empty($ghs)) {
+                    $name = $ghsShop['shopName'] ?? '';
+                    $py = stringUtil::py($name);
+                    $mobile = $ghsShop['mobile'] ?? '';
                     $ghsData = [
                     $ghsData = [
                         'sjId' => $ghsShop['merchantId'],
                         'sjId' => $ghsShop['merchantId'],
                         'shopId' => $ghsShop['id'],
                         'shopId' => $ghsShop['id'],
                         'ownSjId' => $sjId,
                         'ownSjId' => $sjId,
                         'ownShopId' => $sjId,
                         'ownShopId' => $sjId,
-                        'mobile' => $ghsShop['mobile'] ?? '',
+                        'name' => $name,
+                        'py' => $py,
+                        'mobile' => $mobile,
                         'province' => $ghsShop['province'] ?? '',
                         'province' => $ghsShop['province'] ?? '',
                         'city' => $ghsShop['city'] ?? '',
                         'city' => $ghsShop['city'] ?? '',
                         'dist' => $ghsShop['dist'] ?? '',
                         'dist' => $ghsShop['dist'] ?? '',
@@ -101,11 +105,11 @@ class CustomClass extends BaseClass
                 if (empty($ghsShop)) {
                 if (empty($ghsShop)) {
                     util::fail('没有找到门店');
                     util::fail('没有找到门店');
                 }
                 }
-                $name = $ghsShop['shopName'] ?? '';
-                $py = stringUtil::py($name);
-                $mobile = $ghsShop['mobile'] ?? '';
                 $ghs = GhsClass::getByCondition(['ownSjId' => $introSjId, 'sjId' => $sjId, 'shopId' => $shopId]);
                 $ghs = GhsClass::getByCondition(['ownSjId' => $introSjId, 'sjId' => $sjId, 'shopId' => $shopId]);
                 if (empty($ghs)) {
                 if (empty($ghs)) {
+                    $name = $ghsShop['shopName'] ?? '';
+                    $py = stringUtil::py($name);
+                    $mobile = $ghsShop['mobile'] ?? '';
                     $ghsData = [
                     $ghsData = [
                         'sjId' => $sjId,
                         'sjId' => $sjId,
                         'shopId' => $shopId,
                         'shopId' => $shopId,