当前位置: 首页>>代码示例>>PHP>>正文


PHP Model_Broker_AjkBrokerExtend::getDataByAreaCode方法代码示例

本文整理汇总了PHP中Model_Broker_AjkBrokerExtend::getDataByAreaCode方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Broker_AjkBrokerExtend::getDataByAreaCode方法的具体用法?PHP Model_Broker_AjkBrokerExtend::getDataByAreaCode怎么用?PHP Model_Broker_AjkBrokerExtend::getDataByAreaCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model_Broker_AjkBrokerExtend的用法示例。


在下文中一共展示了Model_Broker_AjkBrokerExtend::getDataByAreaCode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: areaEntrustBroker

 /**
  * 板块下经纪人
  * @param $areaCode
  * @return array
  */
 private function areaEntrustBroker($areaCode, $pushOpen, $houseCityId, $houseId)
 {
     $areaBrokerIds = array();
     $rankBrokerIds = array();
     //推送给当前板块的经纪人
     $areaCodeForAjkBrokerExtends = Model_Broker_AjkBrokerExtend::getDataByAreaCode($areaCode);
     //剔除非本城市的经纪人
     $aroundBrokerRaws = array();
     foreach ($areaCodeForAjkBrokerExtends as $areaBroker) {
         if ($areaBroker['cityId'] != $houseCityId) {
             continue;
         }
         $aroundBrokerRaws[] = $areaBroker['brokerId'];
     }
     //读取微聊id
     $areaChatinfos = Model_Mobile_BrokerChatInfo::getActiveBrokerIdsCV($aroundBrokerRaws);
     $areaChatinfos = array_filter($areaChatinfos);
     //读取接口-版本号处理
     $chargeMinCV = APF::get_instance()->get_config("charge_entrust_min_cv");
     $freeMinCV = APF::get_instance()->get_config("free_entrust_min_cv");
     if (empty($areaChatinfos)) {
         return array();
     }
     $brokerIdsBefore = array();
     foreach ($areaChatinfos as $areaChatinfo) {
         //读取接口
         if (!empty($areaChatinfo['chatId'])) {
             $response = Bll_Mobile_ChatInfoBll::getInstance()->apiGetChatInfoByCV($areaChatinfo['chatId']);
         }
         //判断3.7版本以上或者免费城市3.4版本以上
         if ($response['data']['result']['cv'] >= $chargeMinCV || !$pushOpen && $response['data']['result']['cv'] >= $freeMinCV) {
             $brokerIdsBefore[] = $areaChatinfo['brokerId'];
         }
     }
     //将经纪人按Rank值从高到低排序,并限制人数
     $brokerIds = array();
     $rushAreaLimit = APF::get_instance()->get_config('rush_area_limit');
     $rankBrokerInfo = Model_Broker_BrokerActionCenter::getBrokerIdsOrderByRank($brokerIdsBefore, $rushAreaLimit);
     if (count($brokerIdsBefore) > count($rankBrokerInfo)) {
         $this->setLog(date('Y-m-d H:i:s') . '-houseId: ' . $houseId . ' - areaCode: ' . $areaCode . '--板块推送人数已做限制或经纪人活动中心表中缺少数据');
     }
     foreach ($rankBrokerInfo as $rankBroker) {
         $brokerIds[] = $rankBroker['brokerId'];
     }
     if (!empty($brokerIds)) {
         echo '板块已执行成功' . "\n";
         $this->setLog(date('Y-m-d H:i:s') . '-houseId: ' . $houseId . ' - areaCode: ' . $areaCode . '--板块推送执行完成');
     }
     return $brokerIds;
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:55,代码来源:BrokerCommission.php


注:本文中的Model_Broker_AjkBrokerExtend::getDataByAreaCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。