public function handle_request() { $fixPlanList = $this->getFixPlanList(); if (count($fixPlanList) < self::PLAN_LIMIT) { file_put_contents($this->_doneFile, 'DONE'); } else { file_put_contents($this->_doneFile, 'NO'); } if (empty($fixPlanList)) { $this->logMsg(sprintf('没有获取到定价计划[id=%d]', $this->_startId)); return; } foreach ($fixPlanList as $fixPlan) { $fixPlanId = $fixPlan['id']; $this->setCursor($fixPlanId); $brokerInfo = Model_Broker_HzUsersSearch::getUserInfoByUserId($fixPlan['user_id']); if (empty($brokerInfo)) { $this->logMsg(sprintf('没有获取到经纪人[%d]的信息', $fixPlan['user_id'])); } $cityId = $brokerInfo['cityId']; if (Model_Plan_HzPlanBasic::updateFixPlanCityId($fixPlanId, $cityId)) { $this->logMsg(sprintf('更新计划[%d]的cityId为[%d]成功', $fixPlanId, $cityId)); } else { $this->logMsg(sprintf('更新计划[%d]的cityId为[%d]失败', $fixPlanId, $cityId)); } } }