yingzi 1 year ago
parent
commit
bfa252161c
1 changed files with 7 additions and 2 deletions
  1. 7 2
      Util/Common/AgentTools.Class.php

+ 7 - 2
Util/Common/AgentTools.Class.php

@@ -150,6 +150,11 @@ class AgentTools{
         }
         //更新父级等级
         $this->updateShopLevel($parentShopId);
+        if($pOneShopId>0){
+            $this->updateShopLevel($pOneShopId);
+        }
+        
+        
         return ["code"=>1,"msg"=>"绑定成功","data"=>null];
     }
     
@@ -168,12 +173,12 @@ class AgentTools{
         //父级下的社区店数
         $level = 1;
         $levelCount_1 = $this->dbShop->count([["level","=",1],["pOneShopId|pTwoShopId","=",$shopId]]);
-        if($levelCount_1 && $levelCount_1>=5){
+        if($levelCount_1 && $levelCount_1>=$this->agentSettingData["oneToTwoNum"]){
             $level = 2;//5个升级为代理
         }
         //父级下的代理店数
         $levelCount_2 = $this->dbShop->count([["level","=",2],["pOneShopId|pTwoShopId","=",$shopId]]);
-        if($levelCount_2 && $levelCount_2>=10){
+        if($levelCount_2 && $levelCount_2>=$this->agentSettingData["twoToThreeNum"]){
             $level = 3;//5个代理升级为董事
         }
         if($level<=$shopData["level"]){