Пример #1
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     // 判断经纪人是否存在
     $broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     if (!$broker) {
         throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId);
     }
     // 获取经纪人今日有效锁定客户数(未过期临时锁定 + 永久锁定)
     $remainRushCount = Const_CustomerRush::BROKER_MAX_RUSH_COUNT;
     $rushCount = Model_Mobile_BrokerUserRelation::getBrokerTodayLockTimes($brokerId);
     if ($rushCount >= Const_CustomerRush::BROKER_MAX_RUSH_COUNT) {
         $remainRushCount = 0;
     } else {
         $remainRushCount -= $rushCount;
     }
     // 获取经纪人今日有效临时锁定客户数
     $tempLockCountValue = Model_Mobile_BrokerUserRelation::getBrokerTodayTempLockTimes($brokerId);
     // 获取经纪人永久锁定客户数
     $foreverLockCount = Bll_CustomerRush_Lock::getForeverLockCount($brokerId);
     $foreverLockCountValue = $foreverLockCount->count;
     $totalLockCountValue = $foreverLockCountValue + $tempLockCountValue;
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('remainRushCount' => $remainRushCount, 'totalLockCount' => $totalLockCountValue, 'tempLockCount' => $tempLockCountValue, 'foreverLockCount' => $foreverLockCountValue));
 }