فهرست منبع

邀请开店逻辑

shish 5 سال پیش
والد
کامیت
a58ed5a62d

+ 0 - 1
app-hd/controllers/ProductController.php

@@ -115,7 +115,6 @@ class ProductController extends BaseController
         $get = Yii::$app->request->get();
         $id = $get['id'] ?? 0;
         $shopId = $get['shopId'] ?? 0;
-        //$ghsShopAdminId = isset($get['ghsShopAdminId']) && !empty($get['ghsShopAdminId']) ?? 0;
         if (empty($id)) {
             if (!empty($this->shopId)) {
                 $ghs = GhsClass::build($shopId, $this->shopId, $this->sjId);

+ 1 - 1
biz-ghs/admin/classes/AdminClass.php

@@ -78,7 +78,7 @@ class AdminClass extends BaseClass
         if (!empty($adminId)) {
             $shopAdmin = ShopAdminClass::getByCondition(['shopId' => $shopId, 'adminId' => $adminId]);
             if (empty($shopAdmin)) {
-                $text = rand(123123, 987987);
+                $text = (string)rand(123123, 987987);
                 $admin = \biz\admin\classes\AdminClass::getById($adminId, true);
                 if (empty($admin)) {
                     util::fail('没有找到员工');

+ 1 - 1
biz-hd/admin/classes/AdminClass.php

@@ -55,7 +55,7 @@ class AdminClass extends BaseClass
         if (!empty($adminId)) {
             $shopAdmin = ShopAdminClass::getByCondition(['shopId' => $shopId, 'adminId' => $adminId]);
             if (empty($shopAdmin)) {
-                $text = rand(123123, 987987);
+                $text = (string)rand(123123, 987987);
                 $admin = \biz\admin\classes\AdminClass::getById($adminId, true);
                 if (empty($admin)) {
                     util::fail('没有找到员工');

+ 1 - 1
biz-hd/px/classes/PxApplyClass.php

@@ -35,7 +35,7 @@ class PxApplyClass extends BaseClass
 		$capitalType = dict::getConfig('capitalType');
 		$payWay = $data['payWay'] ?? 0;
 		$capitalTypeId = isset($capitalType['id']) ?? 1;
-		$sjId = $shop['sjId'] ?? 0;
+		$sjId = $shop['merchantId'] ?? 0;
 		$shopId = $shop['id'] ?? 0;
 		$capitalData = [
 			'capitalType' => $capitalTypeId,

+ 27 - 6
biz-hd/saas/services/ApplyService.php

@@ -88,9 +88,18 @@ class ApplyService extends BaseService
             util::fail('请填写正确手机号');
         }
         //引荐的员工
-        $shopAdminId = $data['shopAdminId'] ?? 0;
-        if (!empty($shopAdminId)) {
-            $shopAdmin = ShopAdminClass::getById($shopAdminId);
+        $currentShopAdminId = 0;
+        $ghsShopAdminId = $data['ghsShopAdminId'] ?? 0;
+        if (!empty($ghsShopAdminId)) {
+            $currentShopAdminId = $ghsShopAdminId;
+        } else {
+            $hdShopAdminId = $data['hdShopAdminId'] ?? 0;
+            if (!empty($hdShopAdminId)) {
+                $currentShopAdminId = $hdShopAdminId;
+            }
+        }
+        if (!empty($currentShopAdminId)) {
+            $shopAdmin = ShopAdminClass::getById($currentShopAdminId);
             if (!empty($shopAdmin)) {
                 $sjId = $shopAdmin['merchantId'] ?? 0;
                 $sj = MerchantClass::getMerchantById($sjId);
@@ -100,6 +109,7 @@ class ApplyService extends BaseService
                 $data['introShopId'] = $shopAdmin['shopId'] ?? 0;
             }
         }
+
         $licenseNo = $data['licenseNo'] ?? '';
         $mobile = $data['mobile'] ?? '';
         if (empty($licenseNo)) {
@@ -157,10 +167,20 @@ class ApplyService extends BaseService
         if (!empty($has)) {
             util::fail('您已经申请过');
         }
+
         //引荐的员工
-        $shopAdminId = $data['shopAdminId'] ?? 0;
-        if (!empty($shopAdminId)) {
-            $shopAdmin = ShopAdminClass::getById($shopAdminId);
+        $currentShopAdminId = 0;
+        $ghsShopAdminId = $data['ghsShopAdminId'] ?? 0;
+        if (!empty($ghsShopAdminId)) {
+            $currentShopAdminId = $ghsShopAdminId;
+        } else {
+            $hdShopAdminId = $data['hdShopAdminId'] ?? 0;
+            if (!empty($hdShopAdminId)) {
+                $currentShopAdminId = $hdShopAdminId;
+            }
+        }
+        if (!empty($currentShopAdminId)) {
+            $shopAdmin = ShopAdminClass::getById($currentShopAdminId);
             if (!empty($shopAdmin)) {
                 $sjId = $shopAdmin['merchantId'] ?? 0;
                 $sj = MerchantClass::getMerchantById($sjId);
@@ -170,6 +190,7 @@ class ApplyService extends BaseService
                 $data['introShopId'] = $shopAdmin['shopId'] ?? 0;
             }
         }
+
         $prefix = $data['province'] == $data['city'] ? $data['province'] : $data['province'] . $data['city'];
         $dist = $data['dist'] ?? '';
         $floor = $data['floor'] ?? '';

+ 1 - 1
biz-mall/px/classes/PxApplyClass.php

@@ -35,7 +35,7 @@ class PxApplyClass extends BaseClass
 		$capitalType = dict::getConfig('capitalType');
 		$payWay = $data['payWay'] ?? 0;
 		$capitalTypeId = isset($capitalType['id']) ?? 1;
-		$sjId = $shop['sjId'] ?? 0;
+		$sjId = $shop['merchantId'] ?? 0;
 		$shopId = $shop['id'] ?? 0;
 		$capitalData = [
 			'capitalType' => $capitalTypeId,

+ 1 - 1
biz/ghs/classes/GhsClass.php

@@ -26,7 +26,7 @@ class GhsClass extends BaseClass
             util::fail('没有找到供货商的门店');
         }
         $data = [
-            'ghsSjId' => $shop['sjId'],
+            'ghsSjId' => $shop['merchantId'],
             'ghsShopId' => $ghsShopId,
             'sjId' => $sjId,
             'shopId' => $shopId,

+ 1 - 1
biz/sj/classes/CashClass.php

@@ -20,7 +20,7 @@ class CashClass extends BaseClass
     //申请提现
     public static function addApply($shop)
     {
-        $sjId = $shop['sjId'] ?? 0;
+        $sjId = $shop['merchantId'] ?? 0;
         $shopId = $shop['id'];
         $cash = self::getByCondition(['shopId' => $shopId], true, 'addTime DESC');
         if (isset($cash->status) && $cash->status == 1) {