本文整理汇总了PHP中Model_Broker_AjkBrokerExtend::getBrokerInfoByCityId方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Broker_AjkBrokerExtend::getBrokerInfoByCityId方法的具体用法?PHP Model_Broker_AjkBrokerExtend::getBrokerInfoByCityId怎么用?PHP Model_Broker_AjkBrokerExtend::getBrokerInfoByCityId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Broker_AjkBrokerExtend
的用法示例。
在下文中一共展示了Model_Broker_AjkBrokerExtend::getBrokerInfoByCityId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle_request
public function handle_request()
{
$brokerid = $this->getOption('brokerid');
$cityId = 11;
printf('[%s] lastLogId: %s, start: %s, end: %s' . PHP_EOL, date('Y-m-d H:i:s'), $this->lastLogId, $this->start, $this->end);
if (!isset($brokerid)) {
$brokerid = 0;
}
$brokerInfos = Model_Broker_AjkBrokerExtend::getBrokerInfoByCityId($cityId, $this->lastLogId, $this->pageSize, $brokerid, 'K');
if (empty($brokerInfos)) {
printf('[%s] remark: %s' . PHP_EOL, date('Y-m-d H:i:s'), '任务执行完成.');
$this->setStop();
$this->setShStopFlag();
exit;
}
foreach ($brokerInfos as $brokerInfo) {
if ($cityId != $brokerInfo->cityId) {
continue;
}
$this->lastLogId = $brokerInfo->brokerId;
$brokers = Model_Broker_MainBusiness::getMainBusinessByAjkBrokerId($brokerInfo->brokerId);
if (empty($brokers)) {
echo "no data! \r\n";
} else {
if ($brokers->ajkBrokerid) {
printf('[%s]开始处理二手房: 城市ID为%s的历史数据,brokerId为%s' . PHP_EOL, date('Y-m-d H:i:s'), $cityId, $brokers->ajkBrokerid);
//请求二手房API,处理竞价历史数据
$result = Uri_Curl::get($this->url . 'user/broker/transformmoney', array('id' => $brokers->ajkBrokerid, 'status' => 5));
printf('[%s]开始处理二手房: 城市ID为%s的历史数据,brokerId为%s,处理结果:%s' . PHP_EOL, date('Y-m-d H:i:s'), $cityId, $brokers->ajkBrokerid, $result);
}
if ($brokers->hzBrokerid) {
printf('[%s]开始处理租房: 城市ID为%s的历史数据,brokerId为%s' . PHP_EOL, date('Y-m-d H:i:s'), $cityId, $brokers->ajkBrokerid);
//请求租房API,处理竞价历史数据
$result = Uri_Curl::get($this->url . 'zufang/api/broker/transformmoney', array('id' => $brokers->ajkBrokerid, 'status' => 5));
printf('[%s]开始处理租房: 城市ID为%s的历史数据,brokerId为%s,处理结果:%s' . PHP_EOL, date('Y-m-d H:i:s'), $cityId, $brokers->ajkBrokerid, $result);
}
if ($brokers->jpBrokerid) {
printf('[%s]开始处理商业地产: 城市ID为%s的历史数据,brokerId为%s' . PHP_EOL, date('Y-m-d H:i:s'), $cityId, $brokers->ajkBrokerid);
//请求商业地产API,处理竞价历史数据
$result = Uri_Curl::get($this->url . 'jinpu/api/choice/brokerprop', array('brokerid' => $brokers->jpBrokerid, 'status' => 5));
printf('[%s]开始处理商业地产: 城市ID为%s的历史数据,brokerId为%s,处理结果:%s' . PHP_EOL, date('Y-m-d H:i:s'), $cityId, $brokers->ajkBrokerid, $result);
}
sleep(1);
}
}
$params = array('cityId' => $cityId, 'lastLogId' => $this->lastLogId);
$this->setFlag($params);
}