/**
  *获取游戏列表
  */
 public function rebuildAction()
 {
     //基础元素,必须参与验证
     $Config['Time'] = abs(intval($this->request->Time));
     $Config['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
     //URL验证码
     $sign = trim($this->request->sign);
     //私钥,以后要移开到数据库存储
     $p_sign = 'lm';
     $sign_to_check = Base_common::check_sign($Config, $p_sign);
     //不参与验证的元素
     //验证URL是否来自可信的发信方
     if ($sign_to_check == $sign) {
         //验证时间戳,时差超过600秒即认为非法
         if (abs($Config['Time'] - time()) <= 600) {
             $oApp = new Config_App();
             $oPartner = new Config_Partner();
             $oServer = new Config_Server();
             $oPartnerApp = new Config_Partner_App();
             $oSocketType = new Config_SocketType();
             $oApp->reBuildAppConfig();
             $oPartner->reBuildPartnerConfig();
             $oServer->reBuildServerConfig();
             $oPartnerApp->reBuildPartnerAppConfig();
             $oSocketType->reBuildSocketTypeConfig();
         } else {
             $result = array('return' => 0, 'comment' => "时间有误");
         }
     } else {
         $result = array('return' => 0, 'comment' => "验证失败,请检查URL");
     }
     if ($Config['ReturnType']) {
         echo json_encode($result);
     }
 }
 /**
  * 获得权限总列表
  * @return array
  *
  **/
 public function AllParterPermissionList($fields, $group_id)
 {
     $oPartnerApp = new Config_Partner_App();
     $oApp = new Config_App();
     $oArea = new Config_Area();
     //所有游戏信息,游戏id为键值
     $AppList = $oApp->getAll("AppId,name");
     //所有区域 二维数组 区域id为键值
     $TotalArea = $oArea->getAll('AreaId,name');
     //每个游戏所在的区域
     $AreaList = $oPartnerApp->getAreaList();
     //构造新数组,每个区域新添官服和专区
     if (isset($TotalArea)) {
         foreach ($TotalArea as $AreaId => $value) {
             $TotalArea[$AreaId]['partner_type'] = array('1' => array('name' => '官服', 'permission' => 0), '2' => array('name' => '专区', 'permission' => 0));
         }
     }
     //获取所有运营商 二维数组 键值默认排序
     $PartnerAppList = $oPartnerApp->getAll($fields);
     //构建数组 五维数组 键值依次是 游戏应用id(Appid) 区域id(AreaId) 合作商分类(partner_type) 服务商id(PartnerId) 服务商一维数组
     //目的:把构建好的服务商数组赋给下面大循环
     $PartnerAppAreaList = array();
     foreach ($PartnerAppList as $k => $v) {
         $v['permission'] = 0;
         if ($v["PartnerId"] == 1) {
             $PartnerAppAreaList[$v["AppId"]][$v["AreaId"]][1][] = $v;
         } else {
             $PartnerAppAreaList[$v["AppId"]][$v["AreaId"]][2][] = $v;
         }
         //$PartnerAppAreaList[$v["AppId"]][$v["AreaId"]][$v["PartnerId"]][]=$v;
     }
     $totalPartner = array();
     $totalPartner['total'] = $TotalArea;
     $partner = array();
     if (is_array($PartnerAppList)) {
         foreach ($PartnerAppList as $key => $value) {
             //if(!isset($totalPartner['list'][$value['AppId']]))
             //{
             $name = $AppList[$value['AppId']]["name"];
             $AppAreaList = array();
             $AppAreaList = $TotalArea;
             //为了不破坏$TotalArea数组
             foreach ($AppAreaList as $AreaId => $Area) {
                 if (in_array($AreaId, $AreaList[$value["AppId"]])) {
                     foreach ($Area["partner_type"] as $k => $v) {
                         //判断游戏在某个区域内是否有运营商以及这个运营商是官服还是专区
                         //$ParnterType = $oPartnerApp->getPartnerId($value['AppId'],$AreaId);
                         if ($value["PartnerId"] == 1) {
                             $partnerList = $PartnerAppAreaList[$value["AppId"]][$AreaId][1];
                             $AppAreaList[$AreaId]["partner_type"][1]["partner"] = $partnerList;
                         } else {
                             $partnerList = $PartnerAppAreaList[$value["AppId"]][$AreaId][2];
                             $AppAreaList[$AreaId]["partner_type"][2]["partner"] = $partnerList;
                         }
                     }
                 } else {
                     unset($AppAreaList[$AreaId]);
                 }
             }
             $totalPartner['list'][$value['AppId']] = array('name' => $name, 'default' => $AppAreaList);
             //}
             /*if(!isset($totalPartner['list'][$value['AppId']]['partner'][$value['PartnerId']]))
             		{
             			$totalPartner['list'][$value['AppId']]['partner'][$value['PartnerId']] = $value;
             		}*/
         }
     }
     //目的是删除没有运营商的官服和专区  和判断用户是否有权限
     foreach ($totalPartner['list'] as $AppId => &$area_data) {
         foreach ($area_data['default'] as $AreaId => &$area_data) {
             foreach ($area_data['partner_type'] as $partner_type => &$partner_type_data) {
                 if ($partner_type_data["partner"] == null) {
                     unset($totalPartner['list'][$AppId]['default'][$AreaId]['partner_type'][$partner_type]);
                 } else {
                     foreach ($partner_type_data['partner'] as $key => &$partner_data) {
                         //($AppId,$AreaId,$PartnerId,$partner_type,$group_id)_id"
                         $permission = $this->getPermission($AppId, $AreaId, $partner_data['PartnerId'], $partner_type, $group_id);
                         $partner_data['permission'] = $permission['permission'];
                     }
                 }
             }
         }
     }
     return $totalPartner;
 }
Exemple #3
0
<?php

$test_status_list = Config_App::get_test_status_list();
foreach ($this->ticket->test_report as $log) {
    ?>
<table class="list_content" width="100%">
<tr>
<th style="width:50px;"><?php 
    echo $log->acter_name;
    ?>
</th>
<th style="width:50px;"><?php 
    echo $test_status_list[$log->status];
    ?>
</th>
<th><?php 
    echo date('Y-m-d H:i:s', $log->t);
    ?>
</th>
</tr>
<tr>
    <td colspan="3"><?php 
    echo $log->content;
    ?>
</td>
</tr>
</table>
<div class="lineright"></div>
<?php 
}
Exemple #4
0
 public function createExchangeQueueByUser($UserId, $ServerId, $Coin)
 {
     $oServer = new Config_Server();
     $oApp = new Config_App();
     $ServerInfo = $oServer->getRow($ServerId);
     //服务器存在
     if ($ServerInfo['ServerId']) {
         $AppInfo = $oApp->getRow($ServerInfo['AppId']);
         if ($AppInfo['AppId']) {
             $oUser = new Lm_User();
             $UserInfo = $oUser->GetUserById($UserId);
             //用户存在
             if ($UserInfo['UserId']) {
                 $time = time();
                 //初始化兑换信息
                 $ExchangeInfo = array('OrderId' => 0, 'AppId' => $ServerInfo['AppId'], 'PartnerId' => $ServerInfo['PartnerId'], 'Coin' => $Coin, 'ServerId' => $ServerInfo['ServerId'], 'UserId' => $UserInfo['UserId'], 'AppCoin' => $Coin * $AppInfo['exchange_rate'], 'UserSourceId' => $UserInfo['UserSourceId'], 'UserSourceDetail' => $UserInfo['UserSourceDetail'], 'UserSourceProjectId' => $UserInfo['UserSourceProjectId'], 'UserSourceActionId' => $UserInfo['UserSourceActionId'], 'UserRegTime' => $UserInfo['UserRegTime'], 'ExchangeStatus' => 0, 'ReTryCount' => 0, 'ExchangeType' => 3, 'CreateExchangeTime' => $time, 'ExchangeId' => date("YmdHis", $time) . sprintf("%04d", rand(1, 9999)), 'ToSendTime' => $time);
                 $this->db->begin();
                 $queueTable = Base_Widget::getDbTable($this->table_exchange_queue);
                 //添加兑换队列
                 $addQueue = $this->db->insert($queueTable, $ExchangeInfo);
                 $coinUpdate = $oUser->updateUserCoin($UserInfo['UserId'], $Coin * -1);
                 //扣款
                 if ($addQueue && $coinUpdate) {
                     //执行
                     $this->db->commit();
                     return $ExchangeInfo['ExchangeId'];
                 } else {
                     $this->db->rollBack();
                     return false;
                 }
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
 public function sendStatusAction()
 {
     $oPermission = new Config_Permission();
     $oApp = new Config_App();
     $oServer = new Config_Server();
     $oPartnerApp = new Config_Partner_App();
     $oPartner = new Config_Partner();
     $oArea = new Config_Area();
     //获取用户可以查看的游戏列表
     $permitted_app = $oPermission->getApp($this->manager->data_groups, 'AppId,name');
     //预处理地区信息
     $AreaList = $oArea->getAll();
     //检查当前页面权限
     $sign = '?ctl=config/socket.queue&ac=send.status';
     $this->manager->checkMenuPermission($sign, Widget_Manager::MENU_PURVIEW_SELECT);
     $SocketType = $this->oSocketType->getAll();
     //页面输入变量
     $AppId = intval($this->request->AppId);
     $PartnerId = intval($this->request->PartnerId);
     $ServerId = intval($this->request->ServerId);
     $AreaId = intval($this->request->AreaId) ? intval($this->request->AreaId) : 0;
     $app_type = intval($this->request->app_type);
     $partner_type = intval($this->request->partner_type);
     $is_abroad = intval($this->request->is_abroad) ? intval($this->request->is_abroad) : 0;
     $uType = intval($this->request->uType) ? intval($this->request->uType) : 0;
     //时间范围初始化
     $Date = $this->request->Date ? $this->request->Date : date("Y-m-d", time());
     //初始化图表配置
     $divideV = 23;
     $Step = 60;
     //初始化合作商列表
     $permitted_partner = array();
     //初始化服务器列表
     $permitted_server = array();
     //获取当前地区列表
     $AreaList = $oArea->getAbroad($is_abroad, $AreaList);
     //生成允许的地区id数组
     if ($app_type > 0) {
         //筛选是否平台产品
         $permitted_app = $oApp->getApp($app_type, $permitted_app);
     }
     if ($AppId > 0) {
         //获取可查看的权限总表
         $permitted_partner = $oPermission->getPartner($this->manager->data_groups, $AppId, 'PartnerId,name,AreaId');
         //根据合作方式筛选
         $permitted_partner = $oPartnerApp->getPermittedPartnerByPartnerType($partner_type, $permitted_partner);
         //根据所在地区筛选
         $permitted_partner = $oPartnerApp->getPermittedPartnerByPartnerArea($AreaList, $permitted_partner);
         if ($PartnerId > 0) {
             //获取服务器列表
             $permitted_server = $oPermission->getServer($this->manager->data_groups, $AppId, $PartnerId, 'ServerId,name');
         }
     }
     //获取用于查询的权限sql语句
     $SendStatusArr = $this->oSocketQueue->getSendStatus($Date, $ServerId, $uType);
     for ($i = 0; $i < 24 * 60; $i++) {
         $H = intval($i / 60);
         $m = $i - $H * 60;
         if (!isset($SendStatusArr[$i])) {
             $SendStatusArr[$i] = array('Time' => sprintf("%02d", $H) . ":" . sprintf("%02d", $m), 'SendCount' => 0);
         } else {
             $SendStatusArr[$i]['Time'] = sprintf('%02d', $H) . ":" . sprintf('%02d', $m);
         }
     }
     ksort($SendStatusArr);
     # Include FusionCharts PHP Class
     include 'Third/fusion/Includes/FusionCharts_Gen.php';
     # Create Multiseries ColumnD chart object using FusionCharts PHP Class
     $FC = new FusionCharts("MsLine", '100%', '500');
     # Set the relative path of the swf file
     $FC->setSWFPath("../Charts/");
     # Store chart attributes in a variable
     $strParam = "caption='Socket队列发送情况';animation=0;xAxisName='时间';baseFontSize=12;numberPrefix=;decimalPrecision=0;showValues=0;formatNumberScale=0;labelStep={$Step};numvdivlines={$divideV};rotateNames=1;yAxisMinValue=0;yAxisMaxValue=10;numDivLines=9;showAlternateHGridColor=1;alternateHGridAlpha=5;alternateHGridColor='CC3300'";
     # Set chart attributes
     $FC->setChartParams($strParam);
     foreach ($SendStatusArr as $key => $data) {
         $FC->addCategory($data['Time']);
     }
     $FC->addDataset("发送数量");
     foreach ($SendStatusArr as $key => $data) {
         $FC->addChartData($data['SendCount']);
     }
     $page_title = "Socket队列发送情况";
     $page_form_action = $sign;
     //调取模板
     include $this->tpl('Config_SocketQueue_SendStatus');
 }
 /**
  *用户礼包码列表
  */
 public function getUserProductPackCodeAction()
 {
     //基础元素,必须参与验证
     $User['UserId'] = abs(intval($this->request->UserId));
     $User['Used'] = abs(intval($this->request->Used));
     $User['ProductPackId'] = abs(intval($this->request->ProductPackId));
     $User['GenId'] = abs(intval($this->request->GenId));
     $User['PageSize'] = abs(intval($this->request->PageSize));
     $User['Page'] = abs(intval($this->request->Page));
     $User['Time'] = abs(intval($this->request->Time));
     $User['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
     //URL验证码
     $sign = $this->request->sign;
     //私钥,以后要移开到数据库存储
     $p_sign = 'lm';
     $sign_to_check = base_common::check_sign($User, $p_sign);
     //不参与验证的元素
     //验证URL是否来自可信的发信方
     if ($sign_to_check == $sign) {
         if ($User['UserId']) {
             //验证时间戳,时差超过600秒即认为非法
             if (abs($User['Time'] - time()) <= 600) {
                 //查询用户
                 $UserInfo = $this->oUser->GetUserById($User['UserId']);
                 if ($UserInfo['UserId']) {
                     unset($User['ReturnType']);
                     $oProductPack = new Config_Product_Pack();
                     $ProductPackCodeList = $oProductPack->getUserProductPackCodeList($User['UserId'], $User['Used'], $User['ProductPackId'], $User['GenId'], ($User['Page'] - 1) * $User['PageSize'], $User['PageSize']);
                     if (is_array($ProductPackCodeList['UserProductPackCodeList'])) {
                         foreach ($ProductPackCodeList['UserProductPackCodeList'] as $Code => $CodeData) {
                             if (!isset($ProductPackList[$CodeData['ProductPackId']])) {
                                 $ProductPackList[$CodeData['ProductPackId']] = $oProductPack->getRow($CodeData['ProductPackId']);
                             }
                             if (!isset($GenLogList[$CodeData['GenId']])) {
                                 $GenLogList[$CodeData['GenId']] = $oProductPack->GetGenPackCodeLogById($CodeData['GenId']);
                             }
                         }
                     }
                     if (is_array($ProductPackList)) {
                         $oSkin = new Config_Skin();
                         $oHero = new Config_Hero();
                         $oMoney = new Config_Money();
                         $oProduct = new Config_Product_Product();
                         $oApp = new Config_App();
                         foreach ($ProductPackList as $ProductPack => $ProductPackInfo) {
                             unset($Comment);
                             $Comment = json_decode($ProductPackInfo['Comment'], true);
                             if (!isset($ProductInfo[$Type][$ProductPackInfo['AppId']][$ProductId])) {
                                 if (is_array($Comment)) {
                                     foreach ($Comment as $Type => $TypeInfo) {
                                         foreach ($TypeInfo as $ProductId => $Count) {
                                             if (!isset($ProductInfo[$Type][$ProductPackInfo['AppId']][$ProductId])) {
                                                 if ($Type == "hero") {
                                                     $ProductInfo[$Type][$ProductPackInfo['AppId']][$ProductId] = $oHero->getRow($ProductId, $ProductPackInfo['AppId'], '*');
                                                 } elseif ($Type == "skin") {
                                                     $ProductInfo[$Type][$ProductPackInfo['AppId']][$ProductId] = $oSkin->getRow($ProductId, $ProductPackInfo['AppId'], '*');
                                                 } elseif ($Type == "product") {
                                                     $ProductInfo[$Type][$ProductPackInfo['AppId']][$ProductId] = $oProduct->getRow($ProductId, $ProductPackInfo['AppId'], '*');
                                                 } elseif ($Type == "money") {
                                                     $ProductInfo[$Type][$ProductPackInfo['AppId']][$ProductId] = $oMoney->getRow($ProductId, $ProductPackInfo['AppId'], '*');
                                                 } elseif ($Type == "appcoin") {
                                                     $AppInfo = $oApp->getRow($ProductPackInfo['AppId']);
                                                     $comment = json_decode($AppInfo['comment'], true);
                                                     $ProductInfo[$Type][$ProductPackInfo['AppId']][$ProductId]['name'] = $comment['coin_name'];
                                                 }
                                             }
                                             $ProductList[$Type]['detail'][$ProductId] = $ProductInfo[$Type][$ProductPackInfo['AppId']][$ProductId]['name'] . "*" . $Count . "个";
                                         }
                                         $TypeList[$Type] = implode(",", $ProductList[$Type]['detail']);
                                     }
                                     $ProductPackList[$ProductPack]['ProductListText'] = implode(",", $TypeList);
                                 } else {
                                     $ProductPackList[$ProductPack]['ProductListText'] = "无道具";
                                 }
                             }
                         }
                     }
                     $result = array('return' => 1, 'ProductPackCodeList' => $ProductPackCodeList, 'ProductPackList' => $ProductPackList, 'GenLogList' => $GenLogList);
                 } else {
                     $result = array('return' => 2, 'comment' => "无此用户");
                 }
             } else {
                 $result = array('return' => 2, 'comment' => "时间有误");
             }
         } else {
             $result = array('return' => 0, 'comment' => "请选择用户");
         }
     } else {
         $result = array('return' => 2, 'comment' => "验证失败,请检查URL");
     }
     $User['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
     if ($User['ReturnType'] == 1) {
         echo json_encode($result);
     }
 }
Exemple #7
0
<?php 
echo Lib_Global::format_select_options($SYS_DEPARTMENT->list, 0);
?>
</select>
&nbsp;&nbsp;
<button onclick="change_more('ticket_list', 'ticket', 'change_more_department', 'ctl=Commit&act=change_more');">
    修改部门
</button>

&nbsp;&nbsp;
<input id="change_more_version" name="version" type="text" class="inputstyle input_100" />
&nbsp;&nbsp;
<button onclick="change_more('ticket_list', 'ticket', 'change_more_version', 'ctl=Commit&act=change_more');">
    设置版本
</button>
</p>

<p>
<select id="change_more_priority" name="priority"  class="selectstyle">
<?php 
echo Lib_Global::format_select_options(Config_App::get_priority_list(), 0);
?>
</select>
&nbsp;&nbsp;
<button onclick="change_more('ticket_list', 'ticket', 'change_more_priority', 'ctl=Commit&act=change_more');">
    修改优先级
</button>
</p>
    </div>

</div></div>
Exemple #8
0
 public function edit()
 {
     $row = Lib_Req::post('row');
     if (isset($row['content'])) {
         //data:image
         if (false === strpos($row['content'], 'data:image')) {
         } else {
             $this->on_msg('图像格式不正确');
         }
     }
     $is_new = true;
     $O_Ticket = new O_Ticket();
     if ($row['id']) {
         //已经有
         $O_Ticket->init_from_id($row['id']);
         if (!$O_Ticket->is_in_db()) {
             $this->on_msg('不存在');
         }
         $is_new = false;
         //检查权限
         if (isset($row['acter_id']) || isset($row['status'])) {
             $this->_check_pri();
         } else {
             if ($this->acter_id != $O_Ticket->reporter_id) {
                 $this->_check_pri();
             }
         }
     } else {
         //新增
         $O_Ticket->status = Config_App::STATUS_NEW;
         $O_Ticket->reporter_id = $this->acter_id;
     }
     $changed = false;
     foreach ($row as $k => $v) {
         if (!$is_new && $v == $O_Ticket->{$k}) {
             continue;
         }
         $O_Ticket->set($k, '=', $v);
         $changed = true;
     }
     if ($is_new) {
         if (empty($O_Ticket->title) || empty($O_Ticket->content)) {
             $this->on_msg('标题或内容不能为空!');
         }
     }
     if (!$changed) {
         $this->on_msg('修改成功!');
     }
     $refresh_log = false;
     if (!$is_new) {
         $log_a = array('acter_id' => '负责人', 'status' => '状态', 'test_status' => '测试结果');
         $config = array('status' => Config_App::get_status_list(), 'test_status' => Config_App::get_test_status_list());
         $reason = Lib_Req::post('reason');
         foreach ($log_a as $log_column => $log_column_name) {
             if (isset($row[$log_column])) {
                 $O_TicketLog = new O_TicketLog();
                 $O_TicketLog->name = $this->acter->id;
                 $O_TicketLog->k = $log_column_name;
                 if ('acter_id' == $log_column) {
                     $O_TicketLog->v = $row['acter_id'];
                 } else {
                     $O_TicketLog->v = $config[$log_column][$O_Ticket->{$log_column}];
                 }
                 if ($reason) {
                     $O_TicketLog->v .= ' ' . $reason;
                 }
                 $O_Ticket->log[] = $O_TicketLog;
                 $O_Ticket->set('log');
                 $refresh_log = true;
             }
         }
     }
     $O_Ticket->flush();
     if ($refresh_log) {
         $this->view->ticket = $O_Ticket;
         $this->ajax->add_innerhtml('#ticket_log', 'ticket_log');
     }
     $save_and_next = Lib_Req::post('save_and_next');
     if (!$save_and_next) {
         $this->ajax->add_eval_js('msg("提交成功");');
     }
     $this->ajax->add_eval_js('search();');
     if ($is_new) {
         if ($save_and_next) {
             $this->index();
         } else {
             $this->ajax->add_eval_js('cls("ticket_one");');
         }
     }
     $this->on_ajax();
 }
Exemple #9
0
</p>

<p>
类别:
<select forme="val" name="caty" class="selectstyle">
<?php 
$caty_list = Config_App::get_caty_list();
echo Lib_Global::format_select_options($caty_list, 0);
?>
</select>

&nbsp;&nbsp;
优先级:
<select forme="val" name="priority" class="selectstyle">
<?php 
$priority_list = Config_App::get_priority_list();
echo Lib_Global::format_select_options($priority_list, 0);
?>
</select>

&nbsp;&nbsp;
部门:
<select forme="val" name="department" class="selectstyle">
<?php 
$SYS_DEPARTMENT = O_Sys::readone(O_Sys::SYS_DEPARTMENT);
echo Lib_Global::format_select_options($SYS_DEPARTMENT->list, 0);
?>
</select>

&nbsp;&nbsp;
指派负责人: