|
@@ -27,6 +27,10 @@ use JinDouYun\Model\Customer\MMemberBalanceDetail;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+use JinDouYun\Dao\Customer\DCustomer;
|
|
|
|
+use Util\Common\PartnerTools;
|
|
|
|
+
|
|
|
|
+
|
|
class Customer extends BaseController
|
|
class Customer extends BaseController
|
|
{
|
|
{
|
|
/**
|
|
/**
|
|
@@ -35,6 +39,9 @@ class Customer extends BaseController
|
|
private $objMReflectDetail;
|
|
private $objMReflectDetail;
|
|
private $objMMemberBalanceDetail;
|
|
private $objMMemberBalanceDetail;
|
|
private $objMCustomer;
|
|
private $objMCustomer;
|
|
|
|
+
|
|
|
|
+ private $dbCustomer;
|
|
|
|
+ private $partnerTool;
|
|
//private $objTempSaveCache;
|
|
//private $objTempSaveCache;
|
|
|
|
|
|
public function __construct($isCheckAcl = true, $isMustLogin = true)
|
|
public function __construct($isCheckAcl = true, $isMustLogin = true)
|
|
@@ -44,6 +51,13 @@ class Customer extends BaseController
|
|
$this->objMReflectDetail = new MReflectDetail($this->onlineEnterpriseId,$this->onlineUserId);
|
|
$this->objMReflectDetail = new MReflectDetail($this->onlineEnterpriseId,$this->onlineUserId);
|
|
$this->objMMemberBalanceDetail = new MMemberBalanceDetail($this->onlineEnterpriseId,$this->onlineUserId);
|
|
$this->objMMemberBalanceDetail = new MMemberBalanceDetail($this->onlineEnterpriseId,$this->onlineUserId);
|
|
//$this->objTempSaveCache = new TempSaveCache();
|
|
//$this->objTempSaveCache = new TempSaveCache();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //用户表
|
|
|
|
+ $this->dbCustomer = new DCustomer('default');
|
|
|
|
+ $customerTableName = $this->dbCustomer->getTableName($this->dbCustomer->get_Table(), $this->onlineEnterpriseId, 1);
|
|
|
|
+ $this->dbCustomer->setTable($customerTableName);
|
|
|
|
+ $this->partnerTool = new PartnerTools($this->onlineEnterpriseId);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -197,6 +211,32 @@ class Customer extends BaseController
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 更新用户分销推广信息
|
|
|
|
+ */
|
|
|
|
+ public function updateUserNewPartner(){
|
|
|
|
+ $params = $this->request->getRawJson();
|
|
|
|
+ $postData = [
|
|
|
|
+ 'id' => isset($params['id']) ? (int)$params['id'] : 0,
|
|
|
|
+ 'parentId' => isset($params['parentId']) ? (int)$params['parentId'] : 0,//上级id
|
|
|
|
+ 'isPartner' => isset($params['isPartner']) ? (int)$params['isPartner'] : 0,//是否合伙人
|
|
|
|
+ ];
|
|
|
|
+ if(empty($postData["id"])){
|
|
|
|
+ parent::sendOutput('参数错误', ErrorCode::$paramError);
|
|
|
|
+ }
|
|
|
|
+ $postData["isPartner"] = $postData["isPartner"]===1?1:0;
|
|
|
|
+ $userData = $this->dbCustomer->get($postData["id"]);
|
|
|
|
+ if(empty($userData)){
|
|
|
|
+ parent::sendOutput('用户不存在', ErrorCode::$paramError);
|
|
|
|
+ }
|
|
|
|
+ $save=["isPartner"=>$postData["isPartner"]];
|
|
|
|
+ if($userData["parentId"]==0 && $postData["parentId"]!=0){
|
|
|
|
+ $this->partnerTool->setPushCustomer($postData["parentId"], $userData["id"]);
|
|
|
|
+ }
|
|
|
|
+ $this->dbCustomer->update($save,["id"=>$userData["id"]]);
|
|
|
|
+ parent::sendOutput("操作完成");
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 后台批量分配部门及业务员
|
|
* 后台批量分配部门及业务员
|