shish 5 tahun lalu
induk
melakukan
487e3317d1

+ 1 - 3
app-mall/controllers/BaseController.php

@@ -30,7 +30,6 @@ class BaseController extends PublicController
 
         $sjId = 0;
         if (in_array($action->id, $this->guestAccess) == false){
-
             $header = httpUtil::getHeader();
             $shopId = isset($header['account']) ? $header['account'] : 0;
             if (empty($shopId)) {
@@ -53,7 +52,6 @@ class BaseController extends PublicController
             $this->shopId = $shopId;
             $this->shop = $shop;
             $this->sjExtend = MerchantExtendService::getByMerchantId($sjId);
-
         }
 
         $this->isWx = util::isWx();
@@ -71,7 +69,7 @@ class BaseController extends PublicController
             if (in_array($action->id, $this->guestAccess) == false) {
                 $custom = CustomClass::getCurrentCustom($sjId, $userInfo);
                 if (empty($custom)) {
-                    util::fail('没有找到客户');
+                    util::fail('客户信息无效');
                 }
                 $this->custom = $custom;
                 $customId = $custom['id'] ?? 0;

+ 2 - 0
biz/sj/services/MerchantService.php

@@ -83,6 +83,8 @@ class MerchantService extends BaseService
             $deadline = time() + 365 * 86400; //区分供货商(一年)
         }
         $applyData['deadline'] = date("Y-m-d H:i:s", $deadline);
+        $applyData['parentId'] = $applyData['introSjId'] ?? 0;
+        $applyData['parentShopId'] = $applyData['introShopId'] ?? 0;
         $sj = self::add($applyData);
         $sjId = $sj['id'];
         $mobile = $applyData['mobile'] ?? '';

+ 4 - 0
sql.sql

@@ -2169,3 +2169,7 @@ ADD COLUMN `mayGathering`  decimal(9,2) NOT NULL DEFAULT 0 COMMENT '应收款' A
 ALTER TABLE `xhGhsPurchaseOrder`
 ADD INDEX `idx_shopId` (`shopId`) ,
 ADD INDEX `idx_addTime` (`addTime`) ;
+
+====shish 20210422
+ALTER TABLE `xhSj` ADD parentShopId INT NOT NULL DEFAULT 0 COMMENT '父级门店' AFTER parentId;
+ALTER TABLE `xhSj` MODIFY `parentId` INT(11) NOT NULL DEFAULT '0' COMMENT '父级商家id,介绍人';