yingzi 2 年之前
父節點
當前提交
05f7163904
共有 2 個文件被更改,包括 19 次插入1 次删除
  1. 1 1
      Controller/NewCommission/ApiNewAgent.Class.php
  2. 18 0
      Util/Common/AgentTools.Class.php

+ 1 - 1
Controller/NewCommission/ApiNewAgent.Class.php

@@ -38,7 +38,7 @@ class ApiNewAgent extends BaseController
      */
      */
     public function getApiAgentData(){
     public function getApiAgentData(){
 
 
-        $data = $this->agentTool->getAndSetAgentData($this->customerData["id"]);
+        $data = $this->agentTool->apiAgentInfoData($this->onlineUserId);
         if(empty($data) || $data["deleteStatus"]!=5){
         if(empty($data) || $data["deleteStatus"]!=5){
             parent::sendOutput('数据不存在', ErrorCode::$paramError);
             parent::sendOutput('数据不存在', ErrorCode::$paramError);
         }
         }

+ 18 - 0
Util/Common/AgentTools.Class.php

@@ -235,6 +235,24 @@ class AgentTools{
             return ["code"=>1,"msg"=>"绑定成功","data"=>null];
             return ["code"=>1,"msg"=>"绑定成功","data"=>null];
         }
         }
     }
     }
+    /**
+     * 获取代理信息
+     * @param type $userCenterId
+     */
+    public function apiAgentInfoData($userCenterId){
+        $agentData = $this->dbNewAgent->get(["userCenterId"=>$userCenterId]);
+        if(empty($agentData)){
+            return false;
+        }
+        $where=[];
+        $where["agentId"]=$agentData["id"];
+        $where["deleteStatus"]=5;
+        $shopData = $this->dbShop->select($where,"id,name");
+        $agentData["shopData"] = $shopData ? $shopData : [];
+        return $agentData;
+    }
+    
+    
     /**
     /**
      * 获取代理商信息如果不存在则创建
      * 获取代理商信息如果不存在则创建
      * @param type $customerId
      * @param type $customerId