|
|
@@ -17,30 +17,35 @@ class CustomService extends BaseService
|
|
|
{
|
|
|
$shopId = $newShop->id ?? 0;
|
|
|
$introShopId = $applyData['introShopId'] ?? 0;
|
|
|
- //申请人是花店,介绍人是供应商
|
|
|
- if ($applyData['style'] == SjClass::STYLE_RETAIL) {
|
|
|
- if ($applyData['introStyle'] == SjClass::STYLE_SUPPLIER) {
|
|
|
- CustomClass::build($introShopId, $shopId);
|
|
|
+ if (!empty($introShopId)) {
|
|
|
+ //申请人是花店,介绍人是供应商
|
|
|
+ if ($applyData['style'] == SjClass::STYLE_RETAIL) {
|
|
|
+ if ($applyData['introStyle'] == SjClass::STYLE_SUPPLIER) {
|
|
|
+ CustomClass::build($introShopId, $shopId);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- //申请人是供应商,介绍人是花店
|
|
|
- if ($applyData['style'] == SjClass::STYLE_SUPPLIER) {
|
|
|
- if ($applyData['introStyle'] == SjClass::STYLE_RETAIL) {
|
|
|
- CustomClass::build($shopId, $introShopId);
|
|
|
+ //申请人是供应商,介绍人是花店
|
|
|
+ if ($applyData['style'] == SjClass::STYLE_SUPPLIER) {
|
|
|
+ if ($applyData['introStyle'] == SjClass::STYLE_RETAIL) {
|
|
|
+ CustomClass::build($shopId, $introShopId);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- //申请人和介绍人都是花店,但是从供货商采购页邀请也建立关系
|
|
|
- if ($applyData['style'] == SjClass::STYLE_RETAIL) {
|
|
|
- if ($applyData['introStyle'] == SjClass::STYLE_RETAIL) {
|
|
|
- $fromGhsId = $applyData['fromGhsId'] ?? 0;
|
|
|
- if (!empty($fromGhsId)) {
|
|
|
- $fromGhs = GhsClass::getById($fromGhsId, true);
|
|
|
- $ghsShopId = $fromGhs->shopId ?? 0;
|
|
|
- if(!empty($ghsShopId)){
|
|
|
- CustomClass::build($ghsShopId, $shopId);
|
|
|
+ //申请人和介绍人都是花店,但是从供货商采购页邀请也建立关系
|
|
|
+ if ($applyData['style'] == SjClass::STYLE_RETAIL) {
|
|
|
+ if ($applyData['introStyle'] == SjClass::STYLE_RETAIL) {
|
|
|
+ $fromGhsId = $applyData['fromGhsId'] ?? 0;
|
|
|
+ if (!empty($fromGhsId)) {
|
|
|
+ $fromGhs = GhsClass::getById($fromGhsId, true);
|
|
|
+ $ghsShopId = $fromGhs->shopId ?? 0;
|
|
|
+ if (!empty($ghsShopId)) {
|
|
|
+ CustomClass::build($ghsShopId, $shopId);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ //载入全部的供货商
|
|
|
+ GhsClass::bcGhs($shopId);
|
|
|
}
|
|
|
}
|
|
|
|