hxp
2025-06-04 f4a514d5ac952110da846636ecbb9de951eaf3d2
SuperGMToolClient/GMTManage/GMT_CompensationQueryPersonal.php
@@ -3,24 +3,45 @@
include_once "/Common/Logging.php";
include_once "/Account/User.php";
include_once "/language/lang.php";
include_once "/Common/GMTRetCode.php";
\Logging\CreateLogging("GMT_CompensationQueryPersonal.php");
\CommFunc\SessionStart();
$Permission = \User\Permission::P_PersonalMailMgr;
$spid = $_SESSION['spid'];
$toServerID = $_SESSION['serverID'];
$user = new \User\User($_SESSION['UserAccount']);
if (!$user->HavePermission($Permission)) {
   exit;
}
\Logging\LogInfo("_POST:" . print_r($_POST, true));
$queryType = $_POST["queryType"];
$playerFind = $_POST["playerFind"];
$opType = array_key_exists("opType", $_POST) ? $_POST["opType"] : "";
$GUIDInfo = array_key_exists("GUIDInfo", $_POST) ? $_POST["GUIDInfo"] : "";
$serversArray = $user->GetServers();
$packData = array(
   "queryType" => $queryType,
   "playerFind" => $playerFind,
   "opType" => $opType,
   "GUIDInfo" => $GUIDInfo,
);
$retList = \CommFunc\SendGMTToGameServers(True, "GMT_CompensationQueryPersonal", $packData, $spid, array($toServerID));
if (!is_array($retList)) {
   echo "返回错误,没有返回信息";
   exit;
}
$ret = json_decode($retList[$toServerID], true);
$errStr = ParseResult($ret, $resultMsg);
if ($errStr != "") {
   echo $errStr;
   exit;
}
$mailNameArray = CommFunc\getCfgKeyNameContent("mail", true, $spid);
$itemNameArray = CommFunc\getCfgKeyNameContent("item", true, $spid);
$moneyTypeArray = CommFunc\getCfgKeyNameContent("money", true, $spid);
$mailtypes = CommFunc\GetMailTypes();
//------------------------------------------
@@ -28,18 +49,14 @@
//显示表格字段配置 key-参数名,value-说明
$tableArray = array(
   "Num" => \Lang\gettext("编号"),
   "RecState" => \Lang\gettext("状态"),
   "MailType" => \Lang\gettext("类型"),
   "State" => \Lang\gettext("状态"),
   // "MailType" => \Lang\gettext("类型"),
   "Title" => \Lang\gettext("标题"),
   "Gold" => $moneyTypeArray["1"],
   "GoldPaper" => $moneyTypeArray["2"],
   "Silver" => $moneyTypeArray["3"],
   "ItemList" => \Lang\gettext("物品"),
   "CreateTime" => \Lang\gettext("发送时间"),
   "LimitTime" => \Lang\gettext("到期时间"),
   "LimitDays" => \Lang\gettext("有效天数"),
   "Content" => \Lang\gettext("内容"),
   "GUID" => \Lang\gettext("GUID"),
   // "Sender" => \Lang\gettext("发送人"),
);
// 获取字段对应内容
@@ -47,18 +64,16 @@
{
   global $mailtypes;
   $c = $mailDict[$keyName];
   if ($keyName == "RecState") {
      $recState = intval($c);
      $getState = $recState % 10;      // 0 未通知,1 不可领取, 2 可领取, 3 已领取
      $readState = $recState / 10;   // 0 未读,1 已读
      if ($getState === 3) {
         return \Lang\gettext("已领取");
      } else if ($readState === 1) {
         return \Lang\gettext("已读");
      } else if ($readState === 0) {
   if ($keyName == "State") {
      $mailState = intval($c);
      if ($mailState === 1) {
         return "<font color='red'>" . \Lang\gettext("未读") . "</font>";
      } else if ($mailState === 2) {
         return \Lang\gettext("已读");
      } else if ($mailState === 3) {
         return \Lang\gettext("已领取");
      }
      return "<font color='red'>" . $recState . "</font>";
      return "<font color='red'>" . $mailState . "</font>";
   } elseif ($keyName == "Title") {
      if (array_key_exists($c, $mailNameArray)) {
         return $mailNameArray[$c];
@@ -89,21 +104,13 @@
   return $mailDict[$keyName];
}
$resultInfo = $_POST;
$resultMsg = $resultInfo["ResultMsg"];
$queryCmdInfo = $resultMsg["QueryCmdInfo"];
$resultList = array();
if (array_key_exists("ResultList", $resultMsg)) {
   $resultList = $resultMsg["ResultList"];
$mailList = array();
if (array_key_exists("mailList", $resultMsg)) {
   $mailList = $resultMsg["mailList"];
}
$retCount = count($resultList);
$retCount = count($mailList);
if (
   array_key_exists("opType", $queryCmdInfo) && $queryCmdInfo["opType"] == "del" &&
   array_key_exists("ResultType", $resultInfo) && $resultInfo["ResultType"] === 0
) {
if ($opType == "del") {
   echo "<font color='red'>" . \Lang\gettext("删除成功!可继续操作!") . "</font>";
}
?>
@@ -117,10 +124,9 @@
</head>
<body>
   <form id="CompensationQueryPersonal" name="CompensationQueryPersonal" action="/Common/GMCmdProcess.php" method="post">
      <input type="hidden" readonly="readonly" name="queryType" value="<?php if (array_key_exists("queryType", $queryCmdInfo)) echo $queryCmdInfo["queryType"]; ?>" />
      <?php echo \Lang\gettext("目标玩家"); ?>: <input readonly="readonly" name="playerList" value="<?php if (array_key_exists("playerList", $queryCmdInfo)) echo $queryCmdInfo["playerList"]; ?>" />
      <input type="hidden" name="playerFind" value="" />
   <form method="post">
      <input type="hidden" readonly="readonly" name="queryType" value="<?php echo $queryType; ?>" />
      <?php echo \Lang\gettext("目标玩家"); ?>: <input readonly="readonly" name="playerFind" value="<?php echo $playerFind; ?>" />
      <br />
      <hr />
      <?php echo \Lang\gettext("返回条数"); ?>: <?php echo $retCount; ?><br /><br />
@@ -133,7 +139,7 @@
         echo "</tr>";
         for ($i = 0; $i < $retCount; $i++) {
            $mailDict = $resultList[$i];
            $mailDict = $mailList[$i];
            $num = $i + 1;
            echo "<tr>";
            echo "<td align='center'><input name='checkbox" . $i . "' id='checkbox" . $i . "' type='checkbox' />" . $num . "&nbsp;</td>";