public function indexAction() { //检查权限 $PermissionCheck = $this->manager->checkMenuPermission(0); if ($PermissionCheck['return']) { $SexList = $this->oUser->getSexList(); $AuthStatusList = $this->oUser->getAuthStatus(); $AuthIdTypesList = $this->oUser->getAuthIdType(); $params['Sex'] = isset($SexList[strtoupper(trim($this->request->Sex))]) ? substr(strtoupper(trim($this->request->Sex)), 0, 8) : ""; $params['Name'] = urldecode(trim($this->request->Name)) ? substr(urldecode(trim($this->request->Name)), 0, 8) : ""; $params['NickName'] = urldecode(trim($this->request->NickName)) ? substr(urldecode(trim($this->request->NickName)), 0, 8) : ""; $params['AuthStatus'] = isset($AuthStatusList[strtoupper(trim($this->request->AuthStatus))]) ? substr(strtoupper(trim($this->request->AuthStatus)), 0, 8) : ""; $params['Page'] = abs(intval($this->request->Page)) ? abs(intval($this->request->Page)) : 1; $params['PageSize'] = 5; $params['getCount'] = 1; $UserList = $this->oUser->getUserLst($params); //导出EXCEL链接 $export_var = "<a href =" . Base_Common::getUrl('', 'xrace/user', 'user.list.download', $params) . "><导出表格></a>"; //翻页参数 $page_url = Base_Common::getUrl('', 'xrace/user', 'index', $params) . "&Page=~page~"; $page_content = base_common::multi($UserList['UserCount'], $page_url, $params['Page'], $params['PageSize'], 10, $maxpage = 100, $prevWord = '上一页', $nextWord = '下一页'); foreach ($UserList['UserList'] as $UserId => $UserInfo) { echo $UserInfo['auth_state'] . "<br>"; $UserList['UserList'][$UserId]['sex'] = isset($SexList[$UserInfo['sex']]) ? $SexList[$UserInfo['sex']] : "保密"; $UserList['UserList'][$UserId]['AuthStatus'] = isset($AuthStatusList[$UserInfo['auth_state']]) ? $AuthStatusList[$UserInfo['auth_state']] : "未知"; $UserList['UserList'][$UserId]['AuthStatus'] = $UserInfo['auth_state'] == "AUTHED" && isset($AuthIdTypesList[strtoupper(trim($UserInfo['id_type']))]) ? $UserList['UserList'][$UserId]['AuthStatus'] . "/" . $AuthIdTypesList[strtoupper(trim($UserInfo['id_type']))] : $UserList['UserList'][$UserId]['AuthStatus']; $UserList['UserList'][$UserId]['Birthday'] = is_null($UserInfo['birth_day']) ? "未知" : $UserInfo['birth_day']; } include $this->tpl('Xrace_User_UserList'); } else { $home = $this->sign; include $this->tpl('403'); } }
public function authLogAction() { //检查权限 $PermissionCheck = $this->manager->checkMenuPermission(0); if ($PermissionCheck['return']) { //页面参数预处理 $params['StartDate'] = isset($this->request->StartDate) ? substr(strtoupper(trim($this->request->StartDate)), 0, 10) : date("Y-m-d", time()); $params['EndDate'] = isset($this->request->EndDate) ? substr(strtoupper(trim($this->request->EndDate)), 0, 10) : date("Y-m-d", time()); $params['AuthResult'] = isset($this->request->AuthResult) ? substr(strtoupper(trim($this->request->AuthResult)), 0, 8) : ""; $params['ManagerId'] = isset($this->request->ManagerId) ? intval($this->request->ManagerId) : 0; //分页参数 $params['Page'] = abs(intval($this->request->Page)) ? abs(intval($this->request->Page)) : 1; $params['PageSize'] = 2; //获取用户列表时需要获得记录总数 $params['getCount'] = 1; //获取实名认证记录的状态列表 $AuthLogIdStatusList = $this->oUser->getAuthLogStatusTypeList(); //获取所有管理员列表 $ManagerList = $this->manager->getAll('id,name'); //获取实名认证记录 $AuthLog = $this->oUser->getAuthLog($params); //导出EXCEL链接 $export_var = "<a href =" . Base_Common::getUrl('', 'xrace/user', 'auth.log.download', $params) . "><导出表格></a>"; //翻页参数 $page_url = Base_Common::getUrl('', 'xrace/user', 'auth.log', $params) . "&Page=~page~"; $page_content = base_common::multi($AuthLog['AuthLogCount'], $page_url, $params['Page'], $params['PageSize'], 10, $maxpage = 100, $prevWord = '上一页', $nextWord = '下一页'); //初始化一个空的用户数组 $UserList = array(); foreach ($AuthLog['AuthLog'] as $AuthId => $LogInfo) { //管理员账号 $AuthLog['AuthLog'][$AuthId]['ManagerName'] = isset($ManagerList[$LogInfo['op_uid']]) ? $ManagerList[$LogInfo['op_uid']]['name'] : "未知"; $AuthLog['AuthLog'][$AuthId]['AuthResultName'] = isset($AuthLogIdStatusList[$LogInfo['auth_result']]) ? $AuthLogIdStatusList[$LogInfo['auth_result']] : "未知"; // 如果管理员记录已经获取到 if (isset($UserList[$LogInfo['user_id']])) { $ManagerInfo = $UserList[$LogInfo['user_id']]; } else { $ManagerInfo = $this->oUser->getUserInfo($LogInfo['user_id'], "name"); } $AuthLog['AuthLog'][$AuthId]['UserName'] = $ManagerInfo['name']; //实名认证提交的照片 $AuthLog['AuthLog'][$AuthId]['submit_img1'] = isset($AuthLog['AuthLog'][$AuthId]['submit_img1']) ? urldecode($AuthLog['AuthLog'][$AuthId]['submit_img1']) : ""; $AuthLog['AuthLog'][$AuthId]['submit_img2'] = isset($AuthLog['AuthLog'][$AuthId]['submit_img2']) ? urldecode($AuthLog['AuthLog'][$AuthId]['submit_img2']) : ""; } //模板渲染 include $this->tpl('Xrace_User_AuthLog'); } else { $home = $this->sign; include $this->tpl('403'); } }
public function ipListAction() { //检查当前页面权限 $sign = '?ctl=config/machine&ac=ip.list'; $this->manager->checkMenuPermission($sign, Widget_Manager::MENU_PURVIEW_SELECT); $CageList = $this->CageList; $DepotId = $this->request->DepotId; $export = $this->request->export ? intval($this->request->export) : 0; $page = $this->request->page ? intval($this->request->page) : 1; $pageSize = $export ? 0 : 20; $DepotList = $this->DepotList; $ServerList = $this->ServerList; $PartnerList = $this->PartnerList; $param = array(); if ($DepotId) { $param['DepotId'] = $DepotId; $CageIdList = Base_Common::getArrList($CageList[$DepotId]); } $MachineList = $this->oMachine->getIpList($CageIdList, ($page - 1) * $pageSize, $pageSize); $MachineArr = $MachineList['MachineDetail']; foreach ($MachineArr as $MachineId => &$MachineInfo) { $MachineInfo['PartnerName'] = $PartnerList[$ServerList[$MachineInfo['ServerId']]['PartnerId']]['name']; $MachineInfo['LocalIP'] = long2ip($MachineInfo['LocalIP']); $MachineInfo['WebIP'] = long2ip($MachineInfo['WebIP']); $MachineInfo['Purpose'] = $MachineInfo['Purpose']; } //翻页 $pageParam = $param + array("export" => 0); $page_url = Base_Common::getUrl('', 'config/machine', 'ip.list', $pageParam) . "&page=~page~"; $page_content = base_common::multi($MachineList['MachineCount'], $page_url, $page, $pagesize, 10, $maxpage = 100, $prevWord = '上一页', $nextWord = '下一页'); //表格导出 $execlParam = $param + array("export" => 1); $export_var = "<a href =" . Base_Common::getUrl('', 'config/machine', 'ip.list', $execlParam) . "><导出表格></a>"; if ($export == 1) { $oExcel = new Third_Excel(); $FileName = 'IP地址信息'; $oExcel->download($FileName)->addSheet('IP地址信息'); //标题栏 $title = array("序列号", "资产编号", "内网IP", "外网IP", "项目", "用途"); $oExcel->addRows(array($title)); foreach ($MachineArr as $MachineCode => $MachineInfot) { //生成单行数据 $t = array(); $t['MachineCode'] = $MachineInfot['MachineCode']; $t['EstateCode'] = $MachineInfot['EstateCode']; $t['LocalIP'] = $MachineInfot['LocalIP']; $t['WebIP'] = $MachineInfot['WebIP']; $t['PartnerName'] = $MachineInfot['PartnerName']; $t['Purpose'] = $MachineInfot['Purpose']; $oExcel->addRows(array($t)); unset($t); } $oExcel->closeSheet()->close(); } include $this->tpl('Config_Machine_ipList'); }
public function genPackCodeLogAction() { set_time_limit(0); $pagesize = 10; //检查当前页面权限 $sign = '?ctl=config/product/pack&ac=gen.pack.code.log'; $this->manager->checkMenuPermission($sign, Widget_Manager::MENU_PURVIEW_SELECT); //页面输入变量 $AppId = intval($this->request->AppId); $PartnerId = intval($this->request->PartnerId); $GenNum = intval($this->request->GenNum) ? intval($this->request->GenNum) : 100; $AreaId = $this->request->AreaId ? intval($this->request->AreaId) : 0; $app_type = $this->request->app_type ? intval($this->request->app_type) : 0; $partner_type = $this->request->partner_type ? intval($this->request->partner_type) : 0; $is_abroad = $this->request->is_abroad ? intval($this->request->is_abroad) : 0; $page = intval(max($this->request->page, 1)); //时间范围初始化 $StartDate = $this->request->StartDate ? $this->request->StartDate : date("Y-m-01", time()); $EndDate = $this->request->EndDate ? $this->request->EndDate : date("Y-m-d", time()); $ProductPackArr = $this->oProductPack->getAll($AppId); $ProductPackId = $this->request->ProductPackId ? intval($this->request->ProductPackId) : 0; //初始化图表配置 $Input = array('AppId' => $AppId, 'PartnerId' => $PartnerId, 'is_abroad' => $is_abroad, 'AreaId' => $AreaId, 'app_type' => $app_type, 'partner_type' => $partner_type, 'ProductPackId' => $ProductPackId, 'export' => 1); //初始化游戏列表 $permitted_app = $this->permitted_app; //初始化合作商列表 $permitted_partner = array(); //初始化服务器列表 $permitted_server = array(); $AreaList = $this->AreaList; //获取当前地区列表 $AreaList = $this->oArea->getAbroad($is_abroad, $AreaList); //生成允许的地区id数组 if ($app_type > 0) { //筛选是否平台产品 $permitted_app = $this->oApp->getApp($app_type, $permitted_app); } if ($AppId > 0) { //获取可查看的权限总表 $permitted_partner = $this->oPermission->getPartner($this->manager->data_groups, $AppId, 'PartnerId,name,AreaId'); //根据合作方式筛选 $permitted_partner = $this->oPartnerApp->getPermittedPartnerByPartnerType($partner_type, $permitted_partner); //根据所在地区筛选 $permitted_partner = $this->oPartnerApp->getPermittedPartnerByPartnerArea($AreaList, $permitted_partner); } //获取用于查询的权限sql语句 $oWherePartnerPermission = $this->oPermission->getWherePermittedPartner($this->manager->data_groups, $AppId, $PartnerId, $app_type, $partner_type, $AreaList, $AreaId, $is_abroad, ''); $GenLog = $this->oProductPack->getGenLog(0, 0, $ProductPackId, 0, $oWherePartnerPermission, ($page - 1) * $pagesize, $pagesize); $page_url = Base_Common::getUrl('', 'config/product/pack', 'gen.pack.code.log', $Input) . "&page=~page~"; $page_content = base_common::multi($GenLog['GenLogCount'], $page_url, $page, $pagesize, 10, $maxpage = 100, $prevWord = '上一页', $nextWord = '下一页'); if (count($GenLog['GenLog'])) { foreach ($GenLog['GenLog'] as $GenId => $GenInfo) { $GenLog['GenLog'][$GenId]['AppName'] = $permitted_app[$GenInfo['AppId']]['name']; if (!isset($PartnerInfo[$GenInfo['PartnerId']])) { $PartnerInfo[$GenInfo['PartnerId']] = $this->oPartner->getRow($GenInfo['PartnerId']); } if (!isset($ManagerInfo[$GenInfo['ManagerId']])) { $ManagerInfo[$GenInfo['ManagerId']] = $this->manager->getRow($GenInfo['ManagerId']); } $GenLog['GenLog'][$GenId]['PartnerName'] = $PartnerInfo[$GenInfo['PartnerId']]['name']; $GenLog['GenLog'][$GenId]['ManagerName'] = $ManagerInfo[$GenInfo['ManagerId']]['name']; if (!isset($ProductPackList[$GenInfo['ProductPackId']])) { $ProductPackList[$GenInfo['ProductPackId']] = $this->oProductPack->getRow($GenInfo['ProductPackId']); $Comment = json_decode($ProductPackList[$GenInfo['ProductPackId']]['Comment'], true); if (is_array($Comment)) { unset($ProductList); unset($TypeList); unset($ProductInfo); foreach ($Comment as $Type => $TypeInfo) { foreach ($TypeInfo as $ProductId => $Count) { if (!isset($ProductInfo[$Type][$AppId][$ProductId])) { if ($Type == "hero") { $ProductInfo[$Type][$AppId][$ProductId] = $this->oHero->getRow($ProductId, $AppId, '*'); } elseif ($Type == "skin") { $ProductInfo[$Type][$AppId][$ProductId] = $this->oSkin->getRow($ProductId, $AppId, '*'); } elseif ($Type == "product") { $ProductInfo[$Type][$AppId][$ProductId] = $this->oProduct->getRow($ProductId, $AppId, '*'); } elseif ($Type == "money") { $ProductInfo[$Type][$AppId][$ProductId] = $this->oMoney->getRow($ProductId, $AppId, '*'); } elseif ($Type == "appcoin") { $AppInfo = $this->oApp->getRow($AppId); $Comment = json_decode($AppInfo['comment'], true); $ProductInfo[$Type][$AppId][$ProductId]['name'] = $Comment['coin_name']; } } $ProductList[$Type]['detail'][$ProductId] = $ProductInfo[$Type][$AppId][$ProductId]['name'] . "*" . $Count . "个"; } $TypeList[$Type] = implode(",", $ProductList[$Type]['detail']); } $ProductPackArr[$AppId][$GenInfo['ProductPackId']]['ProductListText'] = implode(",", $TypeList); } else { $ProductPackArr[$AppId][$GenInfo['ProductPackId']]['ProductListText'] = "无道具"; } } $GenLog['GenLog'][$GenId]['PackName'] = $ProductPackList[$GenInfo['ProductPackId']]['name']; $GenLog['GenLog'][$GenId]['ProductListText'] = $ProductPackArr[$GenInfo['AppId']][$GenInfo['ProductPackId']]['ProductListText']; $GenLog['GenLog'][$GenId]['ExportUrl'] = "<a href =" . Base_Common::getUrl('', 'config/product/pack', 'download.pack.code', array('export' => 1, 'GenId' => $GenId)) . "><导出礼包码></a>"; } } $page_title = "礼包码生成记录"; $page_form_action = $sign; //调取模板 include $this->tpl('Config_Product_Pack_GenLog'); }