public function userListDownloadAction()
 {
     //检查权限
     $PermissionCheck = $this->manager->checkMenuPermission("UserListDownload");
     if ($PermissionCheck['return']) {
         $SexList = $this->oUser->getSexList();
         $AuthStatusList = $this->oUser->getAuthStatus();
         $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['PageSize'] = 500;
         $oExcel = new Third_Excel();
         $FileName = $this->manager->name() . '用户列表';
         $oExcel->download($FileName)->addSheet('用户');
         //标题栏
         $title = array("用户ID", "微信openId", "姓名", "昵称", "性别", "出生年月", "实名认证状态");
         $oExcel->addRows(array($title));
         $Count = 1;
         $params['Page'] = 1;
         do {
             $UserList = $this->oUser->getUserLst($params);
             $Count = count($UserList['UserList']);
             foreach ($UserList['UserList'] as $UserId => $UserInfo) {
                 //生成单行数据
                 $t = array();
                 $t['user_id'] = $UserInfo['user_id'];
                 $t['open_wx_id'] = $UserInfo['wx_open_id'];
                 $t['open_wx_id'] = $UserInfo['wx_open_id'];
                 $t['name'] = $UserInfo['name'];
                 $t['nick_name'] = $UserInfo['nick_name'];
                 $t['sex'] = isset($SexList[$UserInfo['sex']]) ? $SexList[$UserInfo['sex']] : "保密";
                 $t['AuthStatus'] = isset($AuthStatusList[$UserInfo['auth_state']]) ? $AuthStatusList[$UserInfo['auth_state']] : "未知";
                 $oExcel->addRows(array($t));
                 unset($t);
             }
             $params['Page']++;
             $oExcel->closeSheet()->close();
         } while ($Count > 0);
     } else {
         $home = $this->sign;
         include $this->tpl('403');
     }
 }
Beispiel #2
0
 public function detailAction()
 {
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_UPDATE);
     $SourceProjectId = intval($this->request->SourceProjectId);
     $SourceProject = $this->oSourceProject->getRow($SourceProjectId, '*');
     $SourceProjectDetail = $this->oSourceProject->getDetail($SourceProjectId);
     $SourceList = $this->oSource->getAll();
     $SourceDetailList = $this->oSourceDetail->getAll(0);
     //下载参数
     $export = $this->request->export ? intval($this->request->export) : 0;
     $links = 'http://passport.wjyx.com/?c=media&PageId=2';
     foreach ($SourceProjectDetail as $key => $value) {
         $SourceProjectDetail[$key]['SourceName'] = $SourceList[$value['SourceId']]['name'];
         $SourceProjectDetail[$key]['SourceDetailName'] = $value['SourceDetail'] ? $SourceDetailList[$value['SourceDetail']]['name'] : "<font color = 'red'>全部</font>";
         $SourceProjectDetail[$key]['SourceUrl'] = $links . "&UserSourceId=" . $value['SourceId'] . "&UserSourceDetail=" . $value['SourceDetail'] . "&UserSourceProjectId=" . $value['SourceProjectId'];
         //$SourceProjectDetail[$key]['SourceUrl'] = "&UserSourceId=".$value['SourceId']."UserSourceDetail".$value['SourceDetail']."UserSourceProjectId".$value['SourceProjectId'];
         //			$SourceProjectDetail[$key]['SourceUrl'] = Base_Common::my_authcode($SourceProjectDetail[$key]['SourceUrl'],'','limaogame');
     }
     $param['SourceProjectId'] = $SourceProjectId;
     $execlParam = $param + array("export" => 1);
     $export_var = "<a href =" . Base_Common::getUrl('', 'config/source/project', 'detail', $execlParam) . "><导出表格></a>";
     if ($export == 1) {
         $oExcel = new Third_Excel();
         $FileName = '广告位列表--' . $SourceProject['name'];
         //标题栏
         $title = array("广告商", "广告位", "连接参数");
         $oExcel->download($FileName)->addSheet('广告位列表');
         $oExcel->addRows(array($title));
         foreach ($SourceProjectDetail as $key => $sourceproject_detail) {
             //生成单行数据
             $t['SourceName'] = $sourceproject_detail['SourceName'];
             $t['SourceDetailName'] = $sourceproject_detail['SourceDetailName'];
             $t['SourceUrl'] = $sourceproject_detail['SourceUrl'];
             $oExcel->addRows(array($t));
             unset($t);
         }
         //结束excel
         $oExcel->closeSheet()->close();
     }
     include $this->tpl('Config_Source_Project_Detail_list');
 }
Beispiel #3
0
 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');
 }
Beispiel #4
0
 public function downloadPackCodeAction()
 {
     //检查当前页面权限
     $sign = '?ctl=config/product/pack&ac=gen.pack.code.log';
     $this->manager->checkMenuPermission($sign, Widget_Manager::MENU_PURVIEW_SELECT);
     //页面输入变量
     $GenId = intval($this->request->GenId);
     $permitted_app = $this->permitted_app;
     //初始化合作商列表
     $permitted_partner = array();
     //初始化服务器列表
     $permitted_server = array();
     $AreaList = $this->AreaList;
     //获取当前地区列表
     $AreaList = $this->oArea->getAbroad(0, $AreaList);
     //生成允许的地区id数组
     if ($app_type > 0) {
         //筛选是否平台产品
         $permitted_app = $this->oApp->getApp(0, $permitted_app);
     }
     if ($AppId > 0) {
         //获取可查看的权限总表
         $permitted_partner = $this->oPermission->getPartner($this->manager->data_groups, 0, 'PartnerId,name,AreaId');
         //根据合作方式筛选
         $permitted_partner = $this->oPartnerApp->getPermittedPartnerByPartnerType(0, $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, '');
     $PackCodeList = $this->oProductPack->GetPackCodeByGenId($GenId, $oWherePartnerPermission);
     if (is_array($PackCodeList)) {
         $GenInfo = $this->oProductPack->GetGenPackCodeLogById($GenId);
         $AppName = $permitted_app[$GenInfo['AppId']]['name'];
         $ManagerName = $this->manager->name;
         $FileName = $GenId . "-" . $AppName . "-" . $ManagerName . "-" . date("YmdHis", time());
         $oExcel = new Third_Excel();
         $oExcel->download($FileName)->addSheet('礼包码');
         foreach ($PackCodeList as $key => $value) {
             $t = array();
             //生成单行数据
             $t['Code'] = $value['ProductPackCode'];
             if ($value['UsedUser']) {
                 $UserInfo = $this->oUser->getUserById($value['UsedUser']);
                 $t['Used'] = "已使用";
                 $t['UserName'] = $UserInfo['UserName'];
                 $Used++;
             } else {
                 $t['Used'] = "未使用";
                 $t['UserName'] = "";
             }
             if ($value['AsignUser']) {
                 $UserInfo = $this->oUser->getUserById($value['AsignUser']);
                 $t['Asigned'] = "已分配";
                 $t['AsignUserName'] = $UserInfo['UserName'];
                 $Asigned++;
             } else {
                 $t['Used'] = "未分配";
                 $t['AsignUserName'] = "";
             }
             $oExcel->addRows(array($t));
         }
         unset($t);
         $t['Used'] = "已使用:" . $Used;
         $t['Asigned'] = "已分配:" . $Asigned;
         $oExcel->addRows(array($t));
         //结束excel
         $oExcel->closeSheet()->close();
     }
 }