/** * 获取玩家的信息 */ public function getPlayerDataByAccount($playerAccount = '', $serverId = 0) { if (empty($playerAccount)) { return array(); } $ifConf = $this->getIfConf(); $getData = $this->getGetData($ifConf['PlayerLookup']['get'], $serverId); $postData = array('accountName' => $playerAccount, 'pageSize' => 1, 'pageCount' => 1); $server = $this->_getGlobalData('server/server_list_' . $this->_gameId); $sendUrl = ''; if ($server[$serverId]) { $sendUrl = $server[$serverId]['server_url']; } if (empty($sendUrl)) { return array(); } $utilHttpInterface = $this->_getGlobalData('Util_HttpInterface', 'object'); $data = $utilHttpInterface->result($sendUrl, $ifConf['PlayerLookup']['UrlAppend'], $getData, $postData); $returnData = array(); if ($data && ($data = json_decode($data, true)) && is_array($data['data']['players']['0']) && ($playerInfo = $data['data']['players']['0'])) { $returnData = array('user_id' => Tools::d2s($playerInfo['playerId']), 'user_account' => $playerAccount, 'user_nickname' => $playerInfo['playerName'], 'money_total' => 0, 'money_month' => 0, 'register_date' => strtotime($playerInfo['regTime']), 'ip' => Tools::getClientIP()); } return $returnData; }
/** * 玩家充值查询 */ public function actionDepositList() { $this->_checkOperatorAct(); $this->_createServerList(); $exchangeType = array(0 => '正常充值', 1 => '正常充值(官网)'); if ($_REQUEST['server_id']) { if (strtotime($_GET['startTime'])) { $post['startTime'] = $_GET['startTime']; } if (strtotime($_GET['endTime'])) { $post['endTime'] = $_GET['endTime']; } $_GET['playerId'] = trim($_GET['playerId']); if ($_GET['playerId']) { $post['playerId'] = $_GET['playerId']; } $_GET['playerName'] = trim($_GET['playerName']); if ($_GET['playerName']) { $post['playerName'] = $_GET['playerName']; } $_GET['userAccount'] = trim($_GET['userAccount']); if ($_GET['userAccount']) { $post['account'] = $_GET['userAccount']; } $_GET['transactionId'] = trim($_GET['transactionId']); if ($_GET['transactionId']) { $post['transactionId'] = $_GET['transactionId']; } $_GET['exchangeType'] = intval($_GET['exchangeType']); if ($_GET['exchangeType']) { $post['exchangeType'] = $_GET['exchangeType']; } else { $post['exchangeType'] = key($exchangeType); } $_GET['pageSize'] = intval($_GET['pageSize']); $post['pageSize'] = PAGE_SIZE; if ($_GET['pageSize'] > 0 && $_GET['pageSize'] < 100) { $post['pageSize'] = $_GET['pageSize']; } $post['pageIndex'] = max(1, intval($_GET['page'])); $dataList = $this->getResult($_REQUEST['server_id'], 'user/pay', array(), $post); //"$dataList" = Array [2] // count = (int) 4 // payData = Array [4] // 0 = Array [10] // id = (int) 1 // userName = (string:4) ouuu // playerId = (int) 590 // account = (string:4) ouuu // transactionId = (string:6) 123321 // money = (int) 1 // createTime = (int) 1316750400 // depay = (int) 1 // userGold = (int) 100 // exchangeType = (int) 1 // 1 = Array [10] // 2 = Array [10] // 3 = Array [10] $gameser_list = $this->_getGlobalData('server/server_list_' . self::GAME_ID); if ($gameser_list[$_REQUEST['server_id']]["operator_id"] == "37") { $int_money = 10; } else { $int_money = 100; } if ($dataList['payData'] && is_array($dataList['payData'])) { foreach ($dataList['payData'] as &$list) { $list['money'] = round($list['money'] / $int_money, 2); $pageMoneyTotal += round($list['money'], 2); $list['playerId'] = Tools::d2s($list['playerId']); $list['createTime'] = date('Y-m-d H:i:s', $list['createTime']); $list['exchangeType'] = $exchangeType[$list['exchangeType']]; } $this->_view->assign('dataList', $dataList['payData']); $this->_loadCore('Help_Page'); $this->_helpPage = new Help_Page(array('total' => $dataList['count'], 'perpage' => $post['pageSize'])); $this->_view->assign('pageBox', $this->_helpPage->show()); } } $this->_view->assign('pageMoneyTotal', $pageMoneyTotal); $this->_view->assign('exchangeType', $exchangeType); $this->_utilMsg->createPackageNavBar(); $this->_view->display(); }