10323 【越南】后台公会的特殊需求(新增使用媒体卡汇报;新增可选根据媒体卡类型配置账号分组;充值订单、充值排行、查看玩家支持显示分组;)
7个文件已修改
1个文件已添加
151 ■■■■■ 已修改文件
Common/CommFunc.php 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GMToolClient/GMTManage/GMT_GetPlayerInfo.php 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
InterfaceConfig.php 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
db/DataMgr.php 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
db/struct.php 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eventreport/eventreport.php 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
serverinfo/payorderlist.php 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
serverinfo/payrank.php 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Common/CommFunc.php
@@ -339,6 +339,27 @@
}
/**
 * 根据游戏账号返回平台账号明细
 */
function GetAccountInfoByAccID($accID)
{
    $accIDInfoList = explode("@", $accID);
    $infoCount = count($accIDInfoList);
    if ($infoCount < 3) {
        return array();
    }
    $sid = $accIDInfoList[$infoCount  - 1];
    $platform = $accIDInfoList[$infoCount  - 2];
    $AccountID = join("@", array_slice($accIDInfoList, 0, $infoCount  - 2));
    $accountInfo = array(
        "AccountID" => $AccountID,
        "Channel" => $platform,
        "ServerID" => GetServerIDBySid($sid),
    );
    return $accountInfo;
}
/**
 * 根据字符串取服务器id,一般正常的格式为 sxxx
 * @param string $sid 字符串 s+服务器ID
 * @return number 大于等于0代表服务器ID
GMToolClient/GMTManage/GMT_GetPlayerInfo.php
@@ -1,4 +1,5 @@
<?php
include_once "/db/DataMgr.php";
include_once "/language/lang.php";
include_once "/Common/CommFunc.php";
@@ -44,6 +45,15 @@
    }
}
CommFunc\GetConfig("ServerInfo", "CoupontypeGroup", $CoupontypeGroup);
$CoupontypeGroup = json_decode($CoupontypeGroup, true);
if (isset($CoupontypeGroup)) {
    $playerInfoKeyCh["AccountGroup"] = \Lang\gettext('分组');
    $accountInfo = \CommFunc\GetAccountInfoByAccID($playerInfo["AccID"]);
    $Coupontype = \DataMgr\GetCoupontypeGroup($accountInfo["Channel"], $accountInfo["AccountID"], $accountInfo["ServerID"]);
    $playerInfo["AccountGroup"] = array_key_exists($Coupontype, $CoupontypeGroup) ? $CoupontypeGroup[$Coupontype] : "";
}
//echo $_POST[data];
?>
InterfaceConfig.php
@@ -57,6 +57,9 @@
;自动开服限制时间范围列表,24小时制 [["从x时:分", "到x时:分"], ...]
AutoOpenServerLimitTimeRange = '[["23:30", "00:20"],  ["01:00", "06:00"]]'
;媒体卡类型对应分组,目前用于越南版本运营公会分组 {"卡类型":"显示分组名", ...}
CoupontypeGroup = '{"g001":"公会1", "g002":"公会2"}'
[db]
;接口Mongo数据库IP
db/DataMgr.php
New file
@@ -0,0 +1,19 @@
<?php
namespace  DataMgr;
include_once 'DBOper.php';
/**获取媒体卡账号分组 */
function GetCoupontypeGroup($Channel, $AccountID, $ServerID)
{
    \DBOper\FindOne("CoupontypeGroup", array(
        "Channel" => $Channel,
        "AccountID" => $AccountID,
        "ServerID" => $ServerID
    ), $findData);
    if ($findData) {
        return $findData["Coupontype"];
    }
    return "";
}
db/struct.php
@@ -138,6 +138,13 @@
            array("Channel" => 1, "YMD" => -1),
            array("unique" => true),
        ),
    ),
    "CoupontypeGroup" => array(
        array(
            array("Channel" => 1, "AccountID" => 1, "ServerID" => 1),
            array("unique" => true),
        )
    )
);
eventreport/eventreport.php
@@ -55,6 +55,10 @@
        }
        break;
    case "CouponCode":
        $ok = RecordCoupontypeGroup();
        break;
    default:
        Response(1001, "unknown eventID -> " . $EventID);
        exit;
@@ -253,3 +257,46 @@
    }
    \DBOper\Update("AccountDayActive", $find, $actInfo, false, true);
}
/**记录媒体卡账号分组 */
function RecordCoupontypeGroup()
{
    global $Channel, $RegionName;
    $ServerID = \CommFunc\GetServerIDBySid($RegionName);
    if (!$ServerID) {
        return;
    }
    CommFunc\GetConfig("ServerInfo", "CoupontypeGroup", $CoupontypeGroup);
    if (!$CoupontypeGroup) {
        // \Logging\LogInfo("CoupontypeGroup 不需要");
        return;
    }
    $AccountID = $_GET["accid"];
    $code = $_GET["code"];
    $coupontype = $_GET["coupontype"];
    $find = array("Channel" => $Channel, "AccountID" => $AccountID, "ServerID" => $ServerID);
    if (!\DBOper\FindOne("CoupontypeGroup", $find, $findData)) {
        return;
    }
    if (isset($findData)) {
        // \Logging\LogInfo("已存在,不再重复添加: " . print_r($findData, true));
        return true;
    }
    $insArray = array(
        "Channel" => $Channel,
        "AccountID" => $AccountID,
        "ServerID" => $ServerID,
        "CreateTime" => date("Y-m-d H:i:s"),
        "Coupontype" => $coupontype,
        "Code" => $code,
    );
    if (\DBOper\Insert("CoupontypeGroup", $insArray, $find)) {
        \Logging\LogInfo("记录使用媒体卡首次分组: " . print_r($insArray, true));
        return true;
    }
}
serverinfo/payorderlist.php
@@ -2,6 +2,7 @@
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");
@@ -75,6 +76,7 @@
$tableArray = array(
    "Num" => array(\Lang\gettext("编号"), "3%", "center"),
    "OrderID" => array(\Lang\gettext("订单ID"), "15%", "center"),
    "AccountGroup" => array(\Lang\gettext("分组"), "3%", "center"),
    "AccountID" => array(\Lang\gettext("游戏账号"), "15%", "center"),
    "OrderInfo" => array(\Lang\gettext("商品编号"), "8%", "center"),
    "OrderAmount" => array(\Lang\gettext("支付金额"), "5%", "center"),
@@ -82,12 +84,19 @@
    "Createtime" => array(\Lang\gettext("订单时间"), "11%", "center"),
    "PayTime" => array(\Lang\gettext("支付时间"), "11%", "center"),
    "OrderIDSDK" => array(\Lang\gettext("SDK订单ID"), "15%", "center"),
    "State" => array(\Lang\gettext("状态"), "5%", "center"),
    "State" => array(\Lang\gettext("状态"), "3%", "center"),
    "" => array(\Lang\gettext("操作"), "", "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%";
}
?>
@@ -150,6 +159,9 @@
                        $tdContent = $Num;
                    } elseif ($key == "AccountID") {
                        $tdContent = $info["AccountID"] . "@" .  $info["Channel"] . "@s" . $info["ServerID"];
                    } 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"];
serverinfo/payrank.php
@@ -2,6 +2,7 @@
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("payrank.php");
@@ -15,6 +16,14 @@
}
$server_id = $_SESSION['server_id'];
$isSpecialAccount = False;
\CommFunc\GetConfig("ServerInfo", "SpecialAccountList", $SpecialAccountList);
$SpecialAccountList = explode(",", $SpecialAccountList);
// 特殊账号,只能看本服
if (in_array($UserAccount, $SpecialAccountList)) {
    $isSpecialAccount = True;
}
$match = array("Channel" => $spid);
$limit = 100;
@@ -23,7 +32,7 @@
}
$onlyServerID = $_POST["onlyServerID"];
if ($onlyServerID == "on") {
if ($onlyServerID == "on" || $isSpecialAccount) {
    $serversCfg = $user->GetServersCfg($spid);
    if (array_key_exists($server_id, $serversCfg)) {
        $match["ServerID"] = intval($serversCfg[$server_id]["ServerID"]);
@@ -78,9 +87,16 @@
//显示表格字段配置 key-参数名,value-说明
$tableArray = array(
    "Num" => array(\Lang\gettext("编号"), "3%", "center"),
    "AccountGroup" => array(\Lang\gettext("分组"), "5%", "center"),
    "_id" => array(\Lang\gettext("游戏账号"), "15%", "center"),
    "total" => array(\Lang\gettext("充值总金额"), "5%", "center"),
);
CommFunc\GetConfig("ServerInfo", "CoupontypeGroup", $CoupontypeGroup);
$CoupontypeGroup = json_decode($CoupontypeGroup, true);
if (!isset($CoupontypeGroup)) {
    unset($tableArray['AccountGroup']);
}
?>
@@ -105,9 +121,11 @@
        <input type="text" name="endDate" id="endDate" onclick="new Calendar().show(this);" readonly value="<?php echo $endDate; ?>" size="8" />
        前x名: <input type="number" name="limit" id="limit" value="<?php echo $limit ?>" min="1" />
        <?php
        // 仅显示本服
        echo "&nbsp;&nbsp;";
        echo '<input type="checkbox" name="onlyServerID" id="onlyServerID" ' . ($onlyServerID == "on" ? "checked" : "") . ' />' . \Lang\gettext("仅显示本服");
        if (!$isSpecialAccount) {
            // 仅显示本服
            echo "&nbsp;&nbsp;";
            echo '<input type="checkbox" name="onlyServerID" id="onlyServerID" ' . ($onlyServerID == "on" ? "checked" : "") . ' />' . \Lang\gettext("仅显示本服");
        }
        ?>
        &nbsp;&nbsp;<input type="submit" name="submit" value="<?php echo \Lang\gettext("查询"); ?>" class="button green medium" />
        <hr />
@@ -131,6 +149,10 @@
                    $tdContent = $info[$key];
                    if ($key == "Num") {
                        $tdContent = $Num;
                    } elseif ($key == "AccountGroup") {
                        $idInfo = $info["_id"];
                        $Coupontype = \DataMgr\GetCoupontypeGroup($spid, $idInfo["AccountID"], $idInfo["ServerID"]);
                        $tdContent = array_key_exists($Coupontype, $CoupontypeGroup) ? $CoupontypeGroup[$Coupontype] : "";
                    } elseif ($key == "_id") {
                        $tdContent = $tdContent["AccountID"] . "@" .  $spid . "@s" . $tdContent["ServerID"];
                    }