Ejemplo n.º 1
0
 public static function getInstance()
 {
     if (self::$instance === null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Ejemplo n.º 2
0
 /**
  * 处理经纪人下房子任务
  * @param $brokerId
  * @return bool
  */
 public function dealTask($brokerId)
 {
     // 调api获取套餐推广房源数限制
     // TODO 会提供一个接口返回三网的数据来替代三次调用
     if (!($ajkShouldNum = Bll_Broker_BrokerLimit::getPpcBrokerPromotionLimit($brokerId, Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_ESF_SITE))) {
         return Util_GlobalFunc::buildReturn(0, "该经纪人:{$brokerId}调用api接口获取封二手房顶数据失败");
     }
     if (!($hzShouldNum = Bll_Broker_BrokerLimit::getPpcBrokerPromotionLimit($brokerId, Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_ZF_SITE))) {
         return Util_GlobalFunc::buildReturn(0, "该经纪人:{$brokerId}调用api接口获取封好租顶数据失败");
     }
     if (!($jpShouldNum = Bll_Broker_BrokerLimit::getPpcBrokerPromotionLimit($brokerId, Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_JP_SITE))) {
         return Util_GlobalFunc::buildReturn(0, "该经纪人:{$brokerId}调用api接口获取封金铺顶数据失败");
     }
     $promotion3Web = array(Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_ESF_SITE => $ajkShouldNum, Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_ZF_SITE => $hzShouldNum, Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_JP_SITE => $jpShouldNum);
     $allReturn = array();
     // 分别掉用对用网站处理逻辑
     foreach ($promotion3Web as $siteType => $shouldNum) {
         switch ($siteType) {
             case Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_ESF_SITE:
                 // 二手房
                 $result = BLL_Package_AjkPackageSwitch::deleteExtraHouse($brokerId, $shouldNum);
                 $allReturn['msg'][] = $result['msg'];
                 break;
             case Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_ZF_SITE:
                 // 租房
                 $result = BLL_Package_HzPackageSwitch::deleteExtraHouse($brokerId, $shouldNum);
                 $allReturn['msg'][] = $result['msg'];
                 break;
             case Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_JP_SITE:
                 // 金浦
                 $result = BLL_Package_JpPackageSwitch::getInstance()->DownHouse($brokerId, $shouldNum);
                 $allReturn['msg'][] = $result['msg'];
                 break;
         }
     }
     return $allReturn;
 }