|
|
@@ -26,6 +26,7 @@ class GhsClass extends BaseClass
|
|
|
}
|
|
|
$thisSjId = $ghsShop['merchantId'] ?? 0;
|
|
|
$ghs = self::getByCondition(['ownShopId' => $shopId, 'shopId' => $thisShopId]);
|
|
|
+ $createGhs = false;
|
|
|
if (empty($ghs)) {
|
|
|
$name = $ghsShop['merchantName'] . ' ' . $ghsShop['shopName'];
|
|
|
$py = stringUtil::py($name);
|
|
|
@@ -47,6 +48,7 @@ class GhsClass extends BaseClass
|
|
|
'long' => $ghsShop['long'] ?? '',
|
|
|
];
|
|
|
$ghs = self::addGhs($data);
|
|
|
+ $createGhs = true;
|
|
|
}
|
|
|
|
|
|
$shop = ShopClass::getShopInfo($shopId);
|
|
|
@@ -74,10 +76,11 @@ class GhsClass extends BaseClass
|
|
|
'lat' => $shop['lat'] ?? '',
|
|
|
];
|
|
|
$custom = CustomClass::addCustom($customData);
|
|
|
+ }
|
|
|
+ if ($createGhs) {
|
|
|
$customId = $custom['id'] ?? 0;
|
|
|
self::updateById($ghsId, ['customId' => $customId]);
|
|
|
}
|
|
|
-
|
|
|
return $ghs;
|
|
|
}
|
|
|
|