public function handle_request_internal() { $broker = self::$BrokerInfo; $request = APF::get_instance()->get_request(); $params = $request->get_parameters(); //传入 id, 和日期log_day $id = $params['id']; $date = $params['date']; $userId = $broker['BaseInfo']['USERID']; $dao = new Dao_Broker_AccountBalanceLog(); //通过 $parent_log_id 获取账户日志 $accountSublist = $dao->getAccountSublist($userId, $date, $id); header('Content-Type: application/json'); echo json_encode($accountSublist); return; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $logType = $this->_params['logType']; $page = $this->_params['page']; $limit = $this->_params['limit']; $result = array('status' => 'error', 'message' => ''); // 验证经纪人是否合法 $broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); if (!$broker) { $result['message'] = '经纪人不合法'; return $result; } if (empty($limit)) { $limit = $this->limit; } if (empty($page)) { $page = $this->page; } $endtime = date("Ymd"); $starttime = date("Ymd", time() - 29 * 24 * 3600); $start_num = ($page - 1) * $limit; // 获取数据 $dao = new Dao_Broker_AccountBalanceLog(); //通过 userid 获取账户日志 $list = $dao->searchAccountBalanceLogV2($broker['userId'], $logType, $starttime, $endtime, $start_num, $limit + 1); $haveNext = count($list) > $limit ? 1 : 0; if ($haveNext) { array_pop($list); $nextPage = $page + 1; } else { $nextPage = 0; } $newlist = $this->_dataFormat($list); return array('status' => 'ok', 'data' => array('list' => $newlist, 'nextPage' => $nextPage)); }
public function handle_request_internal() { if (!$this->isBrokerLogin()) { $this->redirect_to_login(); } $apf = APF::get_instance(); $request = APF::get_instance()->get_request(); $objResponse = APF::get_instance()->get_response(); $params = $request->get_parameters(); $brokerId = $request->getBrokerId(); $userId = $request->getUserId(); $cityId = $request->getBrokerCityId(); $brokerInfo = self::$BrokerInfo['BaseInfo']; //非套餐经纪人不能进入该页面,跳转到老账户页面 if ($brokerInfo['PAYTYPE'] != 9999) { $this->redirect($this->getURL('my', '/user/broker/accountmanagement/')); } $logtype = $params['logtype'] ? $params['logtype'] : ""; if (isset($params['p']) && !empty($params['p'])) { $page = intval($params['p']); } else { $page = 1; } if (empty($params['tt']) && empty($params['ff'])) { $starttime = date('Ymd', strtotime('-29 day')); $endtime = date('Ymd'); } else { $starttime = date("Ymd", strtotime($params['ff'])); $endtime = date("Ymd", strtotime($params['tt'])); } $AccountAll = 0; $dao = new Dao_Broker_AccountBalanceLog(); //通过 userid 获取账户日志 $UserAccountInfo = $dao->searchAccountBalanceLog($userId, $logtype, $starttime, $endtime, $page, $this->page_num); if (!empty($UserAccountInfo)) { $AccountAll = $UserAccountInfo['counts']; } unset($UserAccountInfo["counts"]); //echo "<pre>";print_r(isset($params['ff']) ? $params['ff'] : date('Y-m-d', strtotime($starttime)));exit; if (empty($UserAccountInfo) && empty($params['tt']) && empty($params['ff'])) { $starttime = date('Y-m-d', strtotime('-29 day')); $endtime = date('Y-m-d'); } $balance = Bll_Service_Payment::balance(Bll_Service_Payment::SITE_ANJUKE, array('userId' => $userId)); $FreezeAccount = $balance['data']['jp']['frozen'] / 100.0 + $balance['data']['hz']['frozen'] / 100.0 + $balance['data']['ajk']['frozen'] / 100.0; //冻结余额 $UserAccount = $balance['data']['balance'] / 100.0; //账户余额 $UserAccountPerson = $balance['data']['personBalance'] / 100.0; //账户余额(个人) $UserAccountCompany = $balance['data']['companyBalance'] / 100.0; //账户余额(公司) $UserAccountTotal = $FreezeAccount + $UserAccount; //账户总额 = 账户余额 + 冻结余额 //获取经纪人可以购买套餐列表 $companyId = $brokerInfo['COMPANYID']; $canBuyComboList = Bll_Combo_Broker_BrokerComboInfo::getCanBuyComboList($cityId, $companyId); //获取经纪人当前套餐 $brokerCombos = Bll_Combo_Broker_BrokerComboInfo::getBrokerComboAlreadyGroup($userId); $jinPuComingCombo = array(); $rentAndSaleComingCombo = array(); $allComboList = array(); foreach ($brokerCombos['nowCombo'] as $combo) { $comboTip = array('status' => 1, 'name' => $combo['name'], 'content' => $combo['comboStr'], 'beginDate' => date('Y.m.d', $combo['startTimestamp']), 'endDate' => date('Y.m.d', $combo['endTimestamp'])); $allComboList[] = $comboTip; } foreach ($brokerCombos['comingCombo'] as $combo) { $comboTip = array('status' => 0, 'name' => $combo['name'], 'content' => $combo['comboStr'], 'beginDate' => date('Y.m.d', $combo['startTimestamp']), 'endDate' => date('Y.m.d', $combo['endTimestamp'])); $allComboList[] = $comboTip; if (empty($rentAndSaleComingCombo) && ($combo['salePropNum'] > 0 || $combo['rentPropNum'])) { $rentAndSaleComingCombo = $combo; } if (empty($jinPuComingCombo) && $combo['jpPropNum'] > 0) { $rentAndSaleComingCombo = $combo; } } //金铺是否开放 $JinpuOpenConfig = APF::get_instance()->get_config("jinpu_open", "ppc"); $isJp = isset($JinpuOpenConfig[$cityId]) ? $JinpuOpenConfig[$cityId]['open'] : false; $request->set_attribute('isJp', $isJp); $request->set_attribute("AccountLogDownLOadName", sha1($userId . '安居客账户日志明细')); $request->set_attribute("UserAccount", number_format($UserAccount, 2, ".", "")); $request->set_attribute("UserAccountPerson", number_format($UserAccountPerson, 2, ".", "")); $request->set_attribute("UserAccountCompany", number_format($UserAccountCompany, 2, ".", "")); $request->set_attribute("FreezeAccount", number_format($FreezeAccount, 2, ".", "")); $request->set_attribute("UserAccountTotal", number_format($UserAccountTotal, 2, ".", "")); $request->set_attribute("UserAccountInfo", $UserAccountInfo); $request->set_attribute("AccountAll", $AccountAll); $request->set_attribute('params', $params); $request->set_attribute('ff', isset($params['ff']) ? $params['ff'] : date('Y-m-d', strtotime($starttime))); $request->set_attribute('tt', isset($params['tt']) ? $params['tt'] : date('Y-m-d', strtotime($endtime))); $arrPager = $this->getPager($params, $AccountAll); $request->set_attribute('arrPager', $arrPager); $request->set_attribute('canBuyComboList', $canBuyComboList); $request->set_attribute('brokerCombos', $brokerCombos); $request->set_attribute('allComboList', $allComboList); $request->set_attribute('rentAndSaleComingCombo', $rentAndSaleComingCombo); $request->set_attribute('jinPuComingCombo', $jinPuComingCombo); return 'Combo_Account_AccountLog'; }
public function handle_request_internal() { $apf = APF::get_instance(); $request = $apf->get_request(); $response = $apf->get_response(); if ($this->get_broker_usertype() != 2) { //普通用户不能进入此页面 $this->redirect_to_login(); } $params = $request->get_parameters(); $broker = self::$BrokerInfo; //套餐经纪人,进入新的账户管理页面 if ($broker['BaseInfo']['PAYTYPE'] == 9999) { $this->redirect('/ajkbroker/combo/account/accountlog'); } $logtype = $params['logtype'] ? $params['logtype'] : ""; if (isset($params['p']) && !empty($params['p'])) { $page = intval($params['p']); } else { $page = 1; } $userId = $broker['BaseInfo']['USERID']; if (empty($params['tt']) && empty($params['ff'])) { $lastDay = Model_Log_AccountBalanceLog::getLastDayByUserId($broker['BaseInfo']['USERID']); $starttime = $lastDay; $endtime = $lastDay; } else { $starttime = date("Ymd", strtotime($params['ff'])); $endtime = date("Ymd", strtotime($params['tt'])); } $AccountAll = 0; $dao = new Dao_Broker_AccountBalanceLog(); //通过 userid 获取账户日志 $UserAccountInfo = $dao->searchAccountBalanceLog($userId, $logtype, $starttime, $endtime, $page, $this->page_num); if (!empty($UserAccountInfo)) { $AccountAll = $UserAccountInfo['counts']; } unset($UserAccountInfo["counts"]); //echo "<pre>";print_r(isset($params['ff']) ? $params['ff'] : date('Y-m-d', strtotime($starttime)));exit; if (empty($UserAccountInfo) && empty($params['tt']) && empty($params['ff'])) { $starttime = date('Y-m-d', strtotime('-29 day')); $endtime = date('Y-m-d'); } $balance = Bll_Service_Payment::balance(Bll_Service_Payment::SITE_ANJUKE, array('userId' => $userId)); $FreezeAccount = $balance['data']['jp']['frozen'] / 100.0 + $balance['data']['hz']['frozen'] / 100.0 + $balance['data']['ajk']['frozen'] / 100.0; //冻结余额 $UserAccount = $balance['data']['balance'] / 100.0; //账户余额 $UserAccountTotal = $FreezeAccount + $UserAccount; //账户总额 = 账户余额 + 冻结余额 $request->set_attribute("AccountLogDownLOadName", sha1($broker['BaseInfo']['USERID'] . '安居客账户日志明细')); $request->set_attribute("UserAccount", $UserAccount); $request->set_attribute("FreezeAccount", $FreezeAccount); $request->set_attribute("UserAccountTotal", $UserAccountTotal); $request->set_attribute("UserAccountInfo", $UserAccountInfo); $request->set_attribute("AccountAll", $AccountAll); $request->set_attribute('params', $params); $request->set_attribute('ff', isset($params['ff']) ? $params['ff'] : date('Y-m-d', strtotime($starttime))); $request->set_attribute('tt', isset($params['tt']) ? $params['tt'] : date('Y-m-d', strtotime($endtime))); $arrPager = $this->getPager($params, $AccountAll); $request->set_attribute('arrPager', $arrPager); return 'Broker_Accountmanagement'; }