<?php
|
include_once "/Common/Logging.php";
|
include_once "/Account/User.php";
|
include_once "/db/DBOper.php";
|
include_once "/db/DataMgr.php";
|
include_once "/language/lang.php";
|
|
\Logging\CreateLogging("payorderlist.php");
|
$Permission = \User\Permission::P_PayOrder;
|
|
$spid = $_SESSION['spid'];
|
$UserAccount = $_SESSION['UserAccount'];
|
$user = new \User\User($UserAccount);
|
if (!$user->HavePermission($Permission)) {
|
exit;
|
}
|
$server_id = $_SESSION['server_id'];
|
|
$isSpecialAccount = False;
|
\CommFunc\GetConfig("ServerInfo", "SpecialAccountList", $SpecialAccountList);
|
$SpecialAccountList = explode(",", $SpecialAccountList);
|
// 特殊账号,只能看本服
|
if (in_array($UserAccount, $SpecialAccountList)) {
|
$isSpecialAccount = True;
|
}
|
|
$onlyServerID = "on";
|
if (array_key_exists("search", $_POST)) {
|
$onlyServerID = $_POST["onlyServerID"];
|
}
|
$queryAccID = $_POST["AccID"];
|
$queryOrderID = $_POST["OrderID"];
|
$queryOrderIDSDK = $_POST["OrderIDSDK"];
|
|
$find = array("Channel" => $spid);
|
if ($onlyServerID == 'on' || $isSpecialAccount) {
|
$serversCfg = $user->GetServersCfg($spid);
|
if (array_key_exists($server_id, $serversCfg)) {
|
$find["ServerID"] = intval($serversCfg[$server_id]["ServerID"]);
|
}
|
}
|
if ($queryAccID) {
|
$accIDParts = explode("@", $queryAccID);
|
$find["AccountID"] = implode("@", array_slice($accIDParts, 0, count($accIDParts) - 2));
|
}
|
if ($queryOrderID) {
|
$find["OrderID"] = $queryOrderID;
|
}
|
if ($queryOrderIDSDK) {
|
$find["OrderIDSDK"] = $queryOrderIDSDK;
|
}
|
$find["State"] = array('$gte' => 1); // 只显示有结果的订单; 1-成功;2-失败
|
|
$limitDefault = 25;
|
$limit = array_key_exists("limit", $_COOKIE) ? intval($_COOKIE["limit"]) : $limitDefault; // 单页条数
|
$page = 1;
|
if (array_key_exists("limit", $_POST) && intval($_POST["limit"]) > 0) {
|
$limit = intval($_POST["limit"]);
|
}
|
if (array_key_exists("topage", $_POST) && intval($_POST["topage"]) > 1) {
|
$page = intval($_POST["topage"]);
|
} else if (array_key_exists("page", $_POST) && intval($_POST["page"]) > 1) {
|
$page = intval($_POST["page"]);
|
}
|
$skip = ($page - 1) * $limit;
|
\DBOper\Find("PayOrder", $find, $orderArray, null, array("Createtime" => -1), $limit, $skip);
|
$totalCount = count($orderArray);
|
if ($totalCount >= $limit || $page > 1) {
|
$totalCount = \DBOper\Count("PayOrder", $find);
|
}
|
|
// echo "_POST:", json_encode($_POST), "<br/>";
|
// echo "find:", json_encode($find), "<br/>";
|
|
//显示表格字段配置 key-参数名,value-说明
|
$tableArray = array(
|
"Num" => array(\Lang\gettext("编号"), "3%", "center"),
|
"AccountGroup" => array(\Lang\gettext("分组"), "3%", "center"),
|
"PlayerName" => array(\Lang\gettext("玩家名"), "5%", "center"),
|
"AccountID" => array(\Lang\gettext("游戏账号"), "14%", "center"),
|
"OrderInfo" => array(\Lang\gettext("商品编号"), "8%", "center"),
|
"OrderAmount" => array(\Lang\gettext("支付金额"), "5%", "center"),
|
"OriginalAmount" => array(\Lang\gettext("下单金额"), "5%", "center"),
|
"OrderID" => array(\Lang\gettext("订单ID"), "13%", "center"),
|
"OrderIDSDK" => array(\Lang\gettext("SDK订单ID"), "13%", "center"),
|
"PayTime" => array(\Lang\gettext("支付时间"), "11%", "center"),
|
"Createtime" => array(\Lang\gettext("订单时间"), "11%", "center"),
|
"State" => array(\Lang\gettext("状态"), "3%", "center"),
|
"" => array(\Lang\gettext("操作"), "3", "center"),
|
);
|
|
// 保存cookie
|
setcookie("limit", $limit);
|
|
CommFunc\GetConfig("ServerInfo", "CoupontypeGroup", $CoupontypeGroup);
|
$CoupontypeGroup = json_decode($CoupontypeGroup, true);
|
if (!isset($CoupontypeGroup)) {
|
unset($tableArray['AccountGroup']);
|
$tableArray['State'][1] = "5%";
|
}
|
|
?>
|
|
<html>
|
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<title><?php echo \Lang\gettext("充值订单"); ?></title>
|
<link rel="stylesheet" type="text/css" href="/css/table.css">
|
<link rel="stylesheet" type="text/css" href="/css/button.css">
|
</head>
|
|
<body>
|
<center>
|
<p><b><?php echo \Lang\gettext("充值订单"); ?></b></P>
|
</center>
|
<hr />
|
<form id="payorderlist" action="payorderlist.php" method="post">
|
账号: <input type="input" name="AccID" id="AccID" value="<?php echo $queryAccID ?>" />
|
订单ID: <input type="input" name="OrderID" id="OrderID" value="<?php echo $queryOrderID ?>" />
|
SDK订单ID: <input type="input" name="OrderIDSDK" id="OrderIDSDK" value="<?php echo $queryOrderIDSDK ?>" />
|
<?php
|
if (!$isSpecialAccount) {
|
// 仅显示本服
|
echo " ";
|
echo '<input type="checkbox" name="onlyServerID" id="onlyServerID" ' . ($onlyServerID == "on" ? "checked" : "") . ' />' . \Lang\gettext("仅显示本服");
|
}
|
?>
|
<input type="submit" name="submit" value="<?php echo \Lang\gettext("搜索"); ?>" class="button green medium" />
|
<hr />
|
<table width="100%">
|
<?php
|
if ($orderArray) {
|
echo "<thead><tr>";
|
foreach ($tableArray as $value) {
|
echo "<th width=\"" . $value[1] . "\">" . $value[0] . "</td>";
|
}
|
echo "</tr></thead>";
|
} else {
|
echo \Lang\gettext("暂无订单"), "<br/>";
|
}
|
|
$Num = $skip;
|
$roleInfoArray = array();
|
foreach ($orderArray as $info) {
|
$Num += 1;
|
echo "<tr class='trc'>";
|
$OrderID = $info["OrderID"];
|
foreach ($tableArray as $key => $value) {
|
if (!$key) {
|
echo "<td align='center'>";
|
$OrderIDSDK = $info["OrderIDSDK"];
|
$PayTime = $info["PayTime"];
|
echo "<input type=\"button\" value=\"" . \Lang\gettext("补单") . "\" onclick=\"PayOrderRepeat('" . $Num . "', '" . $OrderID . "', '" . $OrderIDSDK . "', '" . $PayTime . "')\" />";
|
echo "</td>";
|
continue;
|
}
|
|
$tdContent = $info[$key];
|
if ($key == "Num") {
|
$tdContent = $Num;
|
} elseif ($key == "AccountID") {
|
$tdContent = $info["AccountID"] . "@" . $info["Channel"] . "@s" . $info["ServerID"];
|
} elseif ($key == "PlayerName") {
|
$accountKey = $info["AccountID"] . "@" . $info["Channel"];
|
$find = array("Channel" => $info["Channel"], "AccountID" => $info["AccountID"]);
|
if (!$roleInfoArray[$accountKey] && \DBOper\FindOne("GameRoles", $find, $findData) && isset($findData)) {
|
$roleInfoArray[$accountKey] = $findData;
|
}
|
$tdContent = "";
|
if ($roleInfoArray[$accountKey] && $roleInfoArray[$accountKey]["s" . $info["ServerID"]]) {
|
$tdContent = $roleInfoArray[$accountKey]["s" . $info["ServerID"]]["PlayerName"];
|
}
|
} elseif ($key == "AccountGroup") {
|
$Coupontype = \DataMgr\GetCoupontypeGroup($info["Channel"], $info["AccountID"], $info["ServerID"]);
|
$tdContent = array_key_exists($Coupontype, $CoupontypeGroup) ? $CoupontypeGroup[$Coupontype] : "";
|
} elseif ($key == "OriginalAmount") {
|
if (array_key_exists("OriginalAmount", $info)) {
|
$tdContent = $info["OriginalAmount"];
|
} else {
|
$tdContent = $info["OrderAmount"];
|
}
|
} elseif ($key == "State") {
|
if ($info[$key] == 1) {
|
$tdContent = \Lang\gettext("成功");
|
} elseif ($info[$key] == 2) {
|
$tdContent = "<span title='" . $info["SyncRet"]["errordesc"] . "' ><font color='red'>" . \Lang\gettext("失败") . "</font></span>";
|
} elseif ($info[$key] == 0) {
|
$tdContent = \Lang\gettext("未支付");
|
}
|
}
|
echo "<td align='" . $value[2] . "' style=\"display:table-cell; vertical-align:middle\">";
|
echo "<div id='" . $key . "_" . $Num . "'>" . $tdContent . "</div>";
|
echo "</td>";
|
}
|
echo "</tr>";
|
}
|
?>
|
</table>
|
<input type="hidden" name="search" value="1" />
|
<?php
|
include_once "/Common/SelectPage.php";
|
?>
|
</form>
|
</body>
|
|
<script type='text/javascript' src="/js/common.js"></script>
|
<script type="text/javascript">
|
function PayOrderRepeat(Num, OrderID, OrderIDSDK, PayTime) {
|
ajaxRequest("payorderrepeat.php?OrderID=" + OrderID + "&OrderIDSDK=" + OrderIDSDK + "&PayTime=" + PayTime,
|
function(xmlhttp) {
|
var br = getbr();
|
var res = JSON.parse(xmlhttp.responseText);
|
if (res["errorcode"] == 0) {
|
var fail = '<?php echo \Lang\gettext("失败") ?>';
|
alert(fail + br + res["errordesc"]);
|
} else {
|
var succ = '<?php echo \Lang\gettext("成功") ?>';
|
alert(succ);
|
var stateObj = document.getElementById("State" + "_" + Num);
|
stateObj.innerHTML = succ;
|
}
|
},
|
"POST"
|
);
|
}
|
</script>
|
|
</html>
|