|
|
@@ -0,0 +1,49 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace Util\Common;
|
|
|
+
|
|
|
+use JinDouYun\Dao\Customer\DCustomer;
|
|
|
+use JinDouYun\Cache\CustomerCache;
|
|
|
+
|
|
|
+class PartnerTool{
|
|
|
+ private $dbCustomer;
|
|
|
+ private $enterpriseId;
|
|
|
+ private $cutTable = 1;//客户按照企业id分表
|
|
|
+ public function __construct($enterpriseId){
|
|
|
+ $this->enterpriseId = $enterpriseId;
|
|
|
+ $this->dbCustomer = new DCustomer('default');
|
|
|
+ $tableName = $this->dbCustomer->getTableName($this->dbCustomer->get_Table(), $this->enterpriseId, $this->cutTable);
|
|
|
+ $this->objDCustomer->setTable($tableName);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function setPushCustomer($parentId=0,$childId=0){
|
|
|
+ if($parentId == 0 || $childId == 0 || $parentId == $childId){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $childData = $this->dbCustomer->get($childId);
|
|
|
+ var_dump($childData);
|
|
|
+ if (empty($childData)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return true;
|
|
|
+
|
|
|
+// $beginStatus = $this->dbCustomer->beginTransaction();
|
|
|
+// $this->dbCustomer->rollBack();
|
|
|
+// $beginStatus && $this->dbCustomer->commit();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ public function delCustomerCache(){
|
|
|
+ $enterpriseId = 0;
|
|
|
+ $customerId = 0;
|
|
|
+ $userCenterId = 0;
|
|
|
+ $objCustomerCache = new CustomerCache();
|
|
|
+ $objCustomerCache->delCustomerData($enterpriseId, $customerId);
|
|
|
+ $objCustomerCache->delCustomerUserData($enterpriseId, $userCenterId);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|