shish 2 месяцев назад
Родитель
Сommit
0b60c9ae2d
2 измененных файлов с 16 добавлено и 1 удалено
  1. 1 1
      app-hd/controllers/ApplyController.php
  2. 15 0
      biz-hd/saas/services/ApplyService.php

+ 1 - 1
app-hd/controllers/ApplyController.php

@@ -276,7 +276,7 @@ class ApplyController extends BaseController
             util::success([
                 'token' => $token,
                 'admin' => $admin,
-                'shopId' => $currentShopId,
+                'shopId' => $newShopId,
                 'shopAdminId' => $shopAdminId,
                 'switchShop' => $switchShop,
                 'pfShopId' => $pfShopId,

+ 15 - 0
biz-hd/saas/services/ApplyService.php

@@ -12,6 +12,7 @@ use biz\sj\classes\MerchantClass;
 use bizHd\goods\classes\CategoryClass;
 use bizHd\goods\classes\GoodsSettingClass;
 use bizHd\item\services\ItemService;
+use bizHd\merchant\classes\ShopClass;
 use bizHd\merchant\services\SjService;
 use bizHd\saas\classes\ApplyClass;
 use bizHd\saas\classes\ApplyExtendClass;
@@ -115,6 +116,20 @@ class ApplyService extends BaseService
                 $data['introShopId'] = $shopAdmin['shopId'] ?? 0;
             }
         }
+        if (empty($data['introShopId'])) {
+            $inviteGhsShopId = $data['inviteGhsShopId'] ?? 0;
+            if (!empty($inviteGhsShopId)) {
+                $ghsShop = ShopClass::getById($inviteGhsShopId, true);
+                $ghsPtStyle = dict::getDict('ptStyle', 'ghs');
+                if (!empty($ghsShop) && $ghsShop->ptStyle == $ghsPtStyle) {
+                    $data['introShopId'] = $inviteGhsShopId;
+                    $data['introStyle'] = SjClass::STYLE_SUPPLIER;
+                    $data['introSjId'] = $ghsShop->sjId ?? 0;
+                    $sj = MerchantClass::getMerchantById($data['introSjId']);
+                    $data['introSjName'] = $sj['name'] ?? '';
+                }
+            }
+        }
         $mobile = $data['mobile'] ?? '';
         $data['licenseNo'] = $mobile;
         $adminId = $data['adminId'] ?? 0;