|
|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace bizGhs\custom\classes;
|
|
|
|
|
|
+use biz\ghs\classes\GhsClass;
|
|
|
use biz\shop\classes\ShopClass;
|
|
|
use biz\sj\classes\MerchantClass;
|
|
|
use biz\sj\classes\SjClass;
|
|
|
@@ -24,12 +25,11 @@ class CustomClass extends BaseClass
|
|
|
$has = CustomClass::getByCondition(['sjId' => $applyData['introSjId'], 'customSjId' => $sjId, 'customShopId' => $shopId]);
|
|
|
if (empty($has)) {
|
|
|
$customData = [
|
|
|
- 'customSjId' => $sjId,
|
|
|
- 'customShopId' => $shopId,
|
|
|
- 'sjId' => $applyData['introSjId'],
|
|
|
+ 'customSjId' => $sjId,//零售商家id
|
|
|
+ 'customShopId' => $shopId,//零售门店id
|
|
|
+ 'sjId' => $applyData['introSjId'],//供货商id
|
|
|
'name' => $applyData['name'],
|
|
|
'mobile' => $applyData['mobile'],
|
|
|
- 'isOpen' => 1,
|
|
|
'province' => $applyData['province'] ?? '',
|
|
|
'city' => $applyData['city'] ?? '',
|
|
|
'dist' => $applyData['dist'] ?? '',
|
|
|
@@ -39,6 +39,27 @@ class CustomClass extends BaseClass
|
|
|
'lat' => $applyData['lat'],
|
|
|
];
|
|
|
CustomClass::addCustom($customData);
|
|
|
+ $introShopId = $applyData['introShopId'] ?? 0;
|
|
|
+ $ghsShop = ShopClass::getShopInfo($introShopId);
|
|
|
+ if (empty($ghsShop)) {
|
|
|
+ util::fail('没有找到门店');
|
|
|
+ }
|
|
|
+ $ghsData = [
|
|
|
+ 'ghsSjId' => $ghsShop['merchantId'],
|
|
|
+ 'ghsShopId' => $ghsShop['id'],
|
|
|
+ 'sjId' => $sjId,
|
|
|
+ 'shopId' => $sjId,
|
|
|
+ 'mobile' => $ghsShop['mobile'] ?? '',
|
|
|
+ 'province' => $ghsShop['province'] ?? '',
|
|
|
+ 'city' => $ghsShop['city'] ?? '',
|
|
|
+ 'dist' => $ghsShop['dist'] ?? '',
|
|
|
+ 'address' => $ghsShop['address'] ?? '',
|
|
|
+ 'floor' => $ghsShop['floor'] ?? '',
|
|
|
+ 'fullAddress' => $ghsShop['fullAddress'] ?? '',
|
|
|
+ 'lat' => $ghsShop['lat'] ?? '',
|
|
|
+ 'long' => $ghsShop['long'] ?? '',
|
|
|
+ ];
|
|
|
+ GhsClass::addGhs($ghsData);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -53,9 +74,9 @@ class CustomClass extends BaseClass
|
|
|
$super = ShopClass::getSuper($introShopId);
|
|
|
$mobile = $super['mobile'] ?? '';
|
|
|
$customData = [
|
|
|
- 'customSjId' => $introSjId,
|
|
|
- 'customShopId' => $introShopId,
|
|
|
- 'sjId' => $sjId,
|
|
|
+ 'customSjId' => $introSjId,//零售商id
|
|
|
+ 'customShopId' => $introShopId,//零售门店id
|
|
|
+ 'sjId' => $sjId,//供货商id
|
|
|
'name' => $name,
|
|
|
'mobile' => $mobile,
|
|
|
'isOpen' => 1,
|
|
|
@@ -68,6 +89,28 @@ class CustomClass extends BaseClass
|
|
|
'lat' => $applyData['lat'],
|
|
|
];
|
|
|
CustomClass::addCustom($customData);
|
|
|
+
|
|
|
+ $ghsShop = ShopClass::getShopInfo($shopId);
|
|
|
+ if (empty($ghsShop)) {
|
|
|
+ util::fail('没有找到门店');
|
|
|
+ }
|
|
|
+
|
|
|
+ $ghsData = [
|
|
|
+ 'ghsSjId' => $sjId,
|
|
|
+ 'ghsShopId' => $shopId,
|
|
|
+ 'sjId' => $introSjId,
|
|
|
+ 'shopId' => $introShopId,
|
|
|
+ 'mobile' => $ghsShop['mobile'] ?? '',
|
|
|
+ 'province' => $ghsShop['province'] ?? '',
|
|
|
+ 'city' => $ghsShop['city'] ?? '',
|
|
|
+ 'dist' => $ghsShop['dist'] ?? '',
|
|
|
+ 'address' => $ghsShop['address'] ?? '',
|
|
|
+ 'floor' => $ghsShop['floor'] ?? '',
|
|
|
+ 'fullAddress' => $ghsShop['fullAddress'] ?? '',
|
|
|
+ 'lat' => $ghsShop['lat'] ?? '',
|
|
|
+ 'long' => $ghsShop['long'] ?? '',
|
|
|
+ ];
|
|
|
+ GhsClass::addGhs($ghsData);
|
|
|
}
|
|
|
}
|
|
|
}
|