public function updateBrokerCompany($brokerid, $sid, $oldstore = 0) { $pdo = APF_DB_Factory::get_instance()->get_pdo("anjuke_master"); $companyName = $this->getStoreInfo($sid); if ($companyName) { $storeName = str_replace($companyName['cstCompanyName'], '', $companyName['ComanyName']); $sql = "update ajk_brokerextend set BelongCom='" . $companyName['cstCompanyName'] . ' ' . $storeName . "',cst_broker_company_id='" . $sid . "' where BrokerId in (" . $brokerid . ")"; } else { $sql = "update ajk_brokerextend set cst_broker_company_id='" . $sid . "' where BrokerId in (" . $brokerid . ")"; } $pdo->exec($sql); //更改门店时重新分配经纪人的客户主任 apf_require_class('DAO_Broker_common'); apf_require_class('BLL_My_Broker_AccountExecutive'); $objAccountExecutiveBLL = new BLL_My_Broker_AccountExecutive(); $arrBrokersID = explode(',', $brokerid); foreach ($arrBrokersID as $intBrokerID) { $arrBroker = DAO_Broker_common::getBrokerDetail($intBrokerID); $arrNewBroker['BROKERID'] = $arrBroker['BROKERID']; $arrNewBroker['WORKERNUM'] = $objAccountExecutiveBLL->getWorkerNum($arrBroker['AREACODE'], $companyName['cst_company_id'], $sid); DAO_Broker_common::updBrokerExtend($arrNewBroker); //============= 增加经纪人加入门店日志============================== $this->logChangeInfo($arrBroker['BROKERID'], $arrBroker['CITYID'], '来自门店邀请经纪人'); } if (!$sid) { $title = "[系统消息] 所属公司变更通知"; $broker_ids = split(",", $brokerid); if (sizeof($broker_ids) > 1) { foreach ($broker_ids as $broker) { $sql = "update ajk_brokerextend set BelongCom='独立经纪人',CompanyId=0,cst_broker_company_id=0 where BrokerId={$broker}"; $pdo->exec($sql); $result = $this->sendForumMessage($brokerid, $title, 1); } } else { $sql = "update ajk_brokerextend set BelongCom='独立经纪人',CompanyId=0,cst_broker_company_id=0 where BrokerId={$brokerid}"; $pdo->exec($sql); $result = $this->sendForumMessage($brokerid, $title, 1); } } else { $title = "[系统消息] 所属门店变更通知"; $old_storename = $this->get_companyname_byid($oldstore); $result = $this->sendForumMessage($brokerid, $title, 2, $old_storename); } return $result; }
/** * 获取爱房经纪人信息 */ public function getAifangBrokerInfo($p_intBrokerId, $p_bolStrictRefreshCache = false) { apf_require_class("DAO_Broker_common"); $arrBrokerInfo = DAO_Broker_common::getAIfangBrokerDetail($p_intBrokerId, $p_bolStrictRefreshCache); return $arrBrokerInfo; }