public function handle_request() { $accountBalanceZeroList = Model_Log_AccountBalanceZeroLog::getLogList($this->_startId, self::LOG_LIMIT); if (empty($accountBalanceZeroList)) { $this->logMsg(sprintf('Id: %d 处理完成', $this->_startId)); return; } foreach ($accountBalanceZeroList as $accountBalanceZero) { $this->setCursor($accountBalanceZero['id']); /** 根据 AccountId 获取UserId */ $accountId = $accountBalanceZero['accountId']; $accountMapping = Model_Payment_AccountMapping::getAccountMappingByAccountId($accountId, Model_Payment_AccountMapping::SITE_TYPE_AJK); if (empty($accountMapping)) { $this->logMsg(sprintf('没有获取到AccountMapping accountId:%d', $accountId)); continue; } $userId = $accountMapping['userId']; $brokerInfo = Model_Broker_AjkBrokerExtend::getBrokerInfoByUserIdEx($userId, array('cityId', 'brokerId', 'userId', 'trueName', 'payType')); if (empty($brokerInfo)) { $this->logMsg(sprintf('没有获取到经纪人信息 accountId:%d userId:%d', $accountId, $userId)); continue; } $brokerId = $brokerInfo['brokerId']; if ($brokerInfo['payType'] != 10000) { $this->logMsg(sprintf('经纪人:%s AccountId:%d UserId:%d BrokerId:%d PayType=%d不是PPC经纪人 ', $brokerInfo['trueName'], $accountId, $userId, $brokerId, $brokerInfo['payType'])); continue; } $cityId = $brokerInfo['cityId']; $data = array('brokerId' => $brokerId, 'cityId' => $cityId, 'type' => 301, 'remark' => '账户余额不足', 'flag' => 0, 'addDate' => time(), 'operateId' => 0, 'from' => __METHOD__, 'siteType' => 4); try { Model_House_UpDown_Task::create($data, date('Ymd'))->save(); } catch (Exception $e) { $this->logMsg(sprintf('经纪人:%s CityId:%d AccountId:%d UserId:%d BrokerId:%d 通知账户没钱失败', $brokerInfo['trueName'], $cityId, $accountId, $userId, $brokerId)); } $this->logMsg(sprintf('经纪人:%s CityId:%d AccountId:%d UserId:%d BrokerId:%d 通知账户没钱成功', $brokerInfo['trueName'], $cityId, $accountId, $userId, $brokerId)); } if (count($accountBalanceZeroList) < self::LOG_LIMIT) { $this->logMsg(sprintf('Id: %d 处理完成', $this->_startId)); return; } }
public function handle_request_internal() { $apf = APF::get_instance(); /** * @var $request AJKRequest */ $this->request = $apf->get_request(); $this->params = $this->request->get_parameters(); $this->broker = self::$BrokerInfo; $this->brokerExtend = Model_Broker_AjkBrokerExtend::getBrokerInfoByUserIdEx($this->broker['BaseInfo']["userId"]); if ($this->get_broker_usertype() != 2) { $this->redirect_to_login(); } //var_dump($this->params['action']); switch ($this->params['action']) { case 'editInfo': $this->editInfo(); default: $this->display(); } return 'Broker_EditInfo'; }