Beispiel #1
0
 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));
 }