From b745a014e3f32f4ef7c81831d8d9457a3b3a230d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 02 十二月 2024 17:03:21 +0800
Subject: [PATCH] 10323 【越南】后台公会的特殊需求(新增使用媒体卡汇报;新增可选根据媒体卡类型配置账号分组;充值订单、充值排行、查看玩家支持显示分组;)

---
 serverinfo/payorderlist.php                  |   14 ++++
 Common/CommFunc.php                          |   21 +++++++
 eventreport/eventreport.php                  |   47 +++++++++++++++
 InterfaceConfig.php                          |    3 +
 db/struct.php                                |    7 ++
 db/DataMgr.php                               |   19 ++++++
 GMToolClient/GMTManage/GMT_GetPlayerInfo.php |   10 +++
 serverinfo/payrank.php                       |   30 ++++++++-
 8 files changed, 146 insertions(+), 5 deletions(-)

diff --git a/Common/CommFunc.php b/Common/CommFunc.php
index d921f11..ccb00a3 100644
--- a/Common/CommFunc.php
+++ b/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;
+}
+
+/**
  * 鏍规嵁瀛楃涓插彇鏈嶅姟鍣╥d锛屼竴鑸甯哥殑鏍煎紡涓� sxxx
  * @param string $sid 瀛楃涓� s+鏈嶅姟鍣↖D
  * @return number 澶т簬绛変簬0浠h〃鏈嶅姟鍣↖D
diff --git a/GMToolClient/GMTManage/GMT_GetPlayerInfo.php b/GMToolClient/GMTManage/GMT_GetPlayerInfo.php
index 4e3b88b..2103587 100644
--- a/GMToolClient/GMTManage/GMT_GetPlayerInfo.php
+++ b/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];
 ?>
 
diff --git a/InterfaceConfig.php b/InterfaceConfig.php
index 8d0cdb2..eebc881 100644
--- a/InterfaceConfig.php
+++ b/InterfaceConfig.php
@@ -57,6 +57,9 @@
 ;鑷姩寮�鏈嶉檺鍒舵椂闂磋寖鍥村垪琛紝24灏忔椂鍒� [["浠巟鏃�:鍒�", "鍒皒鏃�:鍒�"], ...]
 AutoOpenServerLimitTimeRange = '[["23:30", "00:20"],  ["01:00", "06:00"]]'
 
+;濯掍綋鍗$被鍨嬪搴斿垎缁勶紝鐩墠鐢ㄤ簬瓒婂崡鐗堟湰杩愯惀鍏細鍒嗙粍 {"鍗$被鍨�":"鏄剧ず鍒嗙粍鍚�", ...}
+CoupontypeGroup = '{"g001":"鍏細1", "g002":"鍏細2"}'
+
 [db]
 
 ;鎺ュ彛Mongo鏁版嵁搴揑P
diff --git a/db/DataMgr.php b/db/DataMgr.php
new file mode 100644
index 0000000..340db25
--- /dev/null
+++ b/db/DataMgr.php
@@ -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 "";
+}
diff --git a/db/struct.php b/db/struct.php
index b304cd8..0977f9d 100644
--- a/db/struct.php
+++ b/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),
+		)
 	)
 );
 
diff --git a/eventreport/eventreport.php b/eventreport/eventreport.php
index 80715bf..2b9b116 100644
--- a/eventreport/eventreport.php
+++ b/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;
+	}
+}
diff --git a/serverinfo/payorderlist.php b/serverinfo/payorderlist.php
index 75fcfb2..228f01d 100644
--- a/serverinfo/payorderlist.php
+++ b/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"];
diff --git a/serverinfo/payrank.php b/serverinfo/payrank.php
index c26f422..b0300e3 100644
--- a/serverinfo/payrank.php
+++ b/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" />
         鍓峹鍚�: <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"];
                     }

--
Gitblit v1.8.0