From 0e1612b11dc33c3ee4b388d8b08a067072ef2924 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 12 十二月 2024 19:24:38 +0800
Subject: [PATCH] 10162 后台优化(增加报表:首登首充人数、购买X礼包再付人数;)

---
 index.php                           |    4 
 serverrep/firstLoginFirstPayCnt.php |  116 +++++++++++++++++++
 serverrep/xpaypaycnt.php            |  150 +++++++++++++++++++++++++
 Account/User.php                    |    8 +
 serverrep/report.php                |   40 +++++-
 serverrep/ImportAccountLoginpay.php |   15 ++
 6 files changed, 321 insertions(+), 12 deletions(-)

diff --git a/Account/User.php b/Account/User.php
index 72138ec..d037cd7 100644
--- a/Account/User.php
+++ b/Account/User.php
@@ -20,12 +20,14 @@
 		$PermissionModules = array(
 			array(
 				"ModuleID" => "ServerRep",
-				"Name" => \Lang\gettext("鎶ヨ〃"),
+				"Name" => \Lang\gettext("鍏ㄦ湇鎶ヨ〃"),
 				"PList" => array(
 					Permission::P_REP_AllView => array("Name" => \Lang\gettext("鍏ㄦ湇鎬昏")),
 					Permission::P_REP_DailyUser => array("Name" => \Lang\gettext("鍏ㄦ湇姣忔棩鐢ㄦ埛")),
 					Permission::P_REP_KeepLogin => array("Name" => \Lang\gettext("鍏ㄦ湇鐣欏瓨")),
 					Permission::P_REP_LTV => array("Name" => \Lang\gettext("鍏ㄦ湇LTV")),
+					Permission::P_REP_FirstLoginFirstPayCnt => array("Name" => \Lang\gettext("棣栫櫥棣栧厖浜烘暟")),
+					Permission::P_REP_XPayPaycnt => array("Name" => \Lang\gettext("璐拱X绀煎寘鍐嶄粯浜烘暟")),
 				)
 			),
 			array(
@@ -210,11 +212,13 @@
 	const GroupAdmin = "admin";
 	const P_System = "P_System";
 
-	//鎶ヨ〃
+	//鍏ㄦ湇鎶ヨ〃
 	const P_REP_AllView = "P_REP_AllView";
 	const P_REP_DailyUser = "P_REP_DailyUser";
 	const P_REP_KeepLogin = "P_REP_KeepLogin";
 	const P_REP_LTV = "P_REP_LTV";
+	const P_REP_FirstLoginFirstPayCnt = "P_REP_FirstLoginFirstPayCnt";
+	const P_REP_XPayPaycnt = "P_REP_XPayPaycnt";
 
 	//鏈嶅姟鍣�
 	const P_Online = "P_Online";
diff --git a/index.php b/index.php
index 3214fe0..5b587f8 100644
--- a/index.php
+++ b/index.php
@@ -38,11 +38,13 @@
 \Logging\LogInfo("鏉冮檺琛�: " . print_r($permissions, true));
 
 $gmtMenu = array(
-	\Lang\gettext("鎶ヨ〃") => array(
+	\Lang\gettext("鍏ㄦ湇鎶ヨ〃") => array(
 		array(\User\Permission::P_REP_AllView, "serverrep/allview.php", \Lang\gettext("鍏ㄦ湇鎬昏")),
 		array(\User\Permission::P_REP_DailyUser, "serverrep/dailyuser.php", \Lang\gettext("鍏ㄦ湇姣忔棩鐢ㄦ埛")),
 		array(\User\Permission::P_REP_KeepLogin, "serverrep/keeplogin.php", \Lang\gettext("鍏ㄦ湇鐣欏瓨")),
 		array(\User\Permission::P_REP_LTV, "serverrep/ltv.php", \Lang\gettext("鍏ㄦ湇LTV")),
+		array(\User\Permission::P_REP_FirstLoginFirstPayCnt, "serverrep/firstLoginFirstPayCnt.php", \Lang\gettext("棣栫櫥棣栧厖浜烘暟")),
+		array(\User\Permission::P_REP_FirstLoginFirstPayCnt, "serverrep/xpaypaycnt.php", \Lang\gettext("璐拱X绀煎寘鍐嶄粯浜烘暟")),
 	),
 
 	\Lang\gettext("鏈嶅姟鍣�") => array(
diff --git a/serverrep/ImportAccountLoginpay.php b/serverrep/ImportAccountLoginpay.php
index 49c6cb1..b43b7f6 100644
--- a/serverrep/ImportAccountLoginpay.php
+++ b/serverrep/ImportAccountLoginpay.php
@@ -64,11 +64,20 @@
 		logweb("eventYMDOK:" . $eventYMDOK);
 	}
 	\Report\CheckAndExportDailyReport($Channel);
-	logweb("寮�濮嬪鍑虹暀瀛樻姤琛�:" . $Channel);
+	logweb("寮�濮嬪鍑洪鐧婚鍏呮姤琛�:" . $Channel);
 	\Report\CheckAndExportFirstKeepReport($Channel);
 }
-if ($opt == "keep") {
-	logweb("寮�濮嬪鍑虹暀瀛樻姤琛�:" . $Channel);
+if ($opt == "refirst") {
+	logweb("do refirst");
+	$AccountFirstLoginReportOK = \DBOper\Remove("AccountFirstLoginReport", array("Channel" => $Channel));
+	$AccountFirstPayReportOK = \DBOper\Remove("AccountFirstPayReport", array("Channel" => $Channel));
+	$eventYMDOK = \DBOper\Remove("ServerEvent", array("Key" => "FirstKeepReportYMD_" . $Channel));
+	logweb("AccountFirstLoginReportOK:" . $AccountFirstLoginReportOK);
+	logweb("AccountFirstPayReportOK:" . $AccountFirstPayReportOK);
+	logweb("eventYMDOK:" . $eventYMDOK);
+}
+if ($opt == "first" || $opt == "refirst") {
+	logweb("寮�濮嬪鍑洪鐧婚鍏呮姤琛�:" . $Channel);
 	\Report\CheckAndExportFirstKeepReport($Channel);
 }
 logweb("澶勭悊瀹屾瘯!");
diff --git a/serverrep/firstLoginFirstPayCnt.php b/serverrep/firstLoginFirstPayCnt.php
new file mode 100644
index 0000000..14fb040
--- /dev/null
+++ b/serverrep/firstLoginFirstPayCnt.php
@@ -0,0 +1,116 @@
+<?php
+include_once "/Common/Logging.php";
+include_once "/Account/User.php";
+include_once "/language/lang.php";
+include_once "/serverrep/report.php";
+
+\Logging\CreateLogging("rep.firstLoginFirstPayCnt.php");
+$Permission = \User\Permission::P_REP_FirstLoginFirstPayCnt;
+
+$channel = $_SESSION['spid'];
+$UserAccount = $_SESSION['UserAccount'];
+$user = new \User\User($UserAccount);
+if (!$user->HavePermission($Permission)) {
+    exit;
+}
+
+$startDate = array_key_exists("startDate", $_POST) ? $_POST["startDate"] : date("Y-m-d", strtotime("-7 days"));
+$endDate = array_key_exists("endDate", $_POST) ? $_POST["endDate"] : date("Y-m-d");
+$dayList = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
+
+\Report\GetAccountFirstLoginPayReport($channel, $startDate, $endDate, $fistLoginReportArray, $fistPayReportArray);
+// \Logging\LogInfo(print_r($fistLoginReportArray, true));
+
+?>
+
+<!DOCTYPE html>
+<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="gettext" type="application/x-po" href="../language/<?php echo \Lang\getLang(); ?>/LC_MESSAGES/<?php echo \Lang\getjspodomain(); ?>.po" />
+</head>
+
+<body>
+    <center>
+        <p><b><?php echo \Lang\gettext("棣栫櫥鏂板棣栧厖浜烘暟"); ?></b></P>
+    </center>
+    <form method="post">
+        <?php echo \Lang\gettext("棣栫櫥鏃堕棿"); ?>:
+        <input type="text" name="startDate" id="startDate" onclick="new Calendar().show(this);" readonly value="<?php echo $startDate; ?>" size="8" />
+        ~
+        <input type="text" name="endDate" id="endDate" onclick="new Calendar().show(this);" readonly value="<?php echo $endDate; ?>" size="8" />
+        <input type="submit" value="<?php echo \Lang\gettext("鏌ヨ"); ?>" />
+        <hr />
+        <table width="100%">
+            <?php
+            echo "<caption>銆愰鐧绘柊澧為鍏呬汉鏁般��</caption>";
+            echo "<thead><tr>";
+            echo "<th align='center' width='75'>棣栫櫥鏃ユ湡</th>";
+            echo "<th align='center' width='55'>棣栫櫥浜烘暟</th>";
+            foreach ($dayList as $day) {
+                $title = $day . "鏃ヤ汉鏁�";
+                echo "<th align='center' width='70'>" .  $title . "</th>";
+            }
+            echo "<th align='center' width='70'>鎬讳粯璐逛汉鏁�</th>";
+            echo "</tr></thead>";
+            $curYMD = date("Y-m-d");
+            $curDate = new DateTime();
+            foreach ($fistLoginReportArray as $firstYMD => $statYMDInfo) {
+                if ($firstYMD < $startDate) {
+                    continue;
+                }
+                $firstPayCntTotal = 0;
+                foreach ($statYMDInfo as $statInfo) {
+                    $firstPayCntTotal  += ($statInfo["firstPayCnt"] ? $statInfo["firstPayCnt"] : 0);
+                }
+                echo "<tr class='trc'>";
+                echo "<td align='center' width='70'>" . $firstYMD . "</td>";
+                $firstYMDTime = strtotime($firstYMD);
+                $firstLoginCount = 0;
+                foreach ($dayList as $day) {
+                    $statYMD = date("Y-m-d", strtotime("+" . ($day - 1) . " days", $firstYMDTime));
+                    $statInfo = $statYMDInfo[$statYMD] ? $statYMDInfo[$statYMD] : array();
+                    if ($day == 1) {
+                        $firstLoginCount = $statInfo["keepCount"] ? $statInfo["keepCount"] : 0;
+                        echo "<td align='center' width='70'>" . $firstLoginCount . "</td>";
+                    }
+
+                    $firstPayCnt = $statInfo["firstPayCnt"] ? $statInfo["firstPayCnt"] : 0;
+
+                    if ($statYMD > $curYMD) {
+                        $text = "";
+                    } else {
+                        if ($day == 1) {
+                            $text = $firstPayCnt;
+                        } else {
+                            $text = $firstPayCnt;
+                            // if ($firstPayCnt) {
+                            //     $ratio = $firstPayCnt / $firstLoginCount;
+                            //     $text .= "<br/>" . round($ratio, 2) . "";
+                            // }
+                        }
+                    }
+                    echo "<td align='center' width='90'>" .  $text . "</td>";
+                }
+
+                echo "<td align='center' width='90'>" . $firstPayCntTotal . "</td>";
+                echo "</tr>";
+            }
+            if (count($fistLoginReportArray) == 0) {
+                echo "<tr class='trc'><td>鏃犳暟鎹�</td></tr>";
+            }
+            ?>
+        </table>
+        <hr />
+    </form>
+</body>
+<script type='text/javascript' src='/language/gettext.js'></script>
+<script type='text/javascript' src="/js/calendar.js"></script>
+<script type='text/javascript' src="/js/common.js"></script>
+<script type="text/javascript">
+</script>
+
+</html>
\ No newline at end of file
diff --git a/serverrep/report.php b/serverrep/report.php
index 3a92e68..3fdecf1 100644
--- a/serverrep/report.php
+++ b/serverrep/report.php
@@ -147,7 +147,7 @@
 	);
 }
 
-/**妫�鏌ュ苟瀵煎嚭棣栫櫥/棣栧厖鐣欏瓨姣忔棩鎶ヨ〃 */
+/**妫�鏌ュ苟瀵煎嚭棣栫櫥/棣栧厖姣忔棩鎶ヨ〃 */
 function CheckAndExportFirstKeepReport($Channel)
 {
 	$eventKey = "FirstKeepReportYMD_" . $Channel;
@@ -208,12 +208,16 @@
 		foreach ($ymdArray as $ReportYMD => $statInfo) {
 			$keepCount = $statInfo["keepCount"] ? $statInfo["keepCount"] : 0;
 			$payTotal = $statInfo["payTotal"] ? $statInfo["payTotal"] : 0;
+			$payCnt = $statInfo["payCnt"] ? $statInfo["payCnt"] : 0;
+			$firstPayCnt = $statInfo["firstPayCnt"] ? $statInfo["firstPayCnt"] : 0;
 			array_push($batchInsDatas, array(
 				"Channel" => $Channel,
 				"CreateYMD" => $CreateYMD,
 				"ReportYMD" => $ReportYMD,
 				"KeepCount" => $keepCount,
 				"PayTotal" => $payTotal,
+				"PayCnt" => $payCnt,
+				"FirstPayCnt" => $firstPayCnt,
 			));
 		}
 	}
@@ -224,6 +228,7 @@
 		if (!\DBOper\BatchInsert("AccountFirstLoginReport", $batchInsDatas)) {
 			return;
 		}
+		\Logging\LogInfo("AccountFirstLoginReport 鎻掑叆OK:" . count($batchInsDatas));
 	}
 
 	// 鐢熸垚鎻掑叆鏁版嵁
@@ -246,6 +251,7 @@
 		if (!\DBOper\BatchInsert("AccountFirstPayReport", $batchInsDatas)) {
 			return;
 		}
+		\Logging\LogInfo("AccountFirstPayReport 鎻掑叆OK:" . count($batchInsDatas));
 	}
 
 	// 鍏ㄩ儴澶勭悊瀹屾瘯鎵嶆洿鏂�
@@ -257,7 +263,7 @@
  * 缁熻棣栫櫥鐩稿叧鐣欏瓨鏃ユ湡鎶ヨ〃锛屽寘鍚厖鍊�(鐢ㄤ簬ltv璁$畻)
  * @param string $Channel
  * @param string $YMD 瑕佺粺璁$殑鎶ヨ〃鏃ユ湡yyyy-MM-dd
- * @param array $fistLoginReportArray 缁熻棣栫櫥鎶ヨ〃缁撴灉 {棣栫櫥鏃ユ湡:{缁熻鏃ユ湡:{keepCount:x, payTotal:x}} ...}}
+ * @param array $fistLoginReportArray 缁熻棣栫櫥鎶ヨ〃缁撴灉 {棣栫櫥鏃ユ湡:{缁熻鏃ユ湡:{keepCount:x, payTotal:x, payCnt:x, firstPayCnt:x}} ...}}
  * @param array $fistPayReportArray 缁熻棣栧厖鎶ヨ〃缁撴灉 {棣栧厖鏃ユ湡:{缁熻鏃ユ湡:{keepCount:x}} ...}}
  * @param array $accountFirstLoginDateInfo 璐﹀彿棣栫櫥鏃ユ湡淇℃伅 {accountID:firstLoginYMD, ...}
  * @param array $accountFirstPayDateInfo 璐﹀彿棣栧厖鏃ユ湡淇℃伅 {accountID:firstPayYMD, ...}
@@ -336,6 +342,18 @@
 		}
 	}
 
+	// 浠婃棩棣栦粯璐﹀彿
+	if (
+		!\DBOper\Find("AccountFirstPay", array("Channel" => $Channel, "PayYMD" => $YMD), $firstPayRetArray, array("AccountID" => 1))
+		|| !isset($firstPayRetArray)
+	) {
+		return;
+	}
+	$accountFirstPayDict = array(); // 缁熻鏃ユ湡棣栦粯璐﹀彿
+	foreach ($firstPayRetArray as $firstPayInfo) {
+		$accountFirstPayDict[$firstPayInfo["AccountID"]] = 1;
+	}
+
 	if (
 		!\DBOper\Find(
 			"PayOrder",
@@ -369,13 +387,20 @@
 			}
 			$statYMDInfo = $fistLoginReportArray[$FirstLoginYMD];
 			if (!isset($statYMDInfo[$YMD])) {
-				$statYMDInfo[$YMD] = array();
+				$statYMDInfo[$YMD] = array("keepCount" => 0, "payTotal" => 0, "payCnt" => 0, "firstPayCnt" => 0);
 			}
 			$statInfo = $statYMDInfo[$YMD];
 			$statInfo["keepCount"] = ($statInfo["keepCount"] ? $statInfo["keepCount"] : 0) + 1;
 
 			$payTotal = $accountPayDict[$AccountID] ? $accountPayDict[$AccountID] : 0;
 			$statInfo["payTotal"] = ($statInfo["payTotal"] ? $statInfo["payTotal"] : 0) + $payTotal;
+			if ($payTotal > 0) {
+				$statInfo["payCnt"] = ($statInfo["payCnt"] ? $statInfo["payCnt"] : 0) + 1;
+			}
+
+			if ($accountFirstPayDict[$AccountID]) {
+				$statInfo["firstPayCnt"] = ($statInfo["firstPayCnt"] ? $statInfo["firstPayCnt"] : 0) + 1;
+			}
 
 			$statYMDInfo[$YMD] = $statInfo;
 			$fistLoginReportArray[$FirstLoginYMD] = $statYMDInfo;
@@ -735,14 +760,14 @@
  * @param string $Channel
  * @param string $fromYMD 璧峰鏃ユ湡yyyy-MM-dd
  * @param string $toYMD 鍒版棩鏈焬yyy-MM-dd
- * @param array &$fistLoginReportArray {棣栫櫥鏃ユ湡:{缁熻鏃ユ湡:{keepCount:x, payTotal:x}} ...}}
+ * @param array &$fistLoginReportArray {棣栫櫥鏃ユ湡:{缁熻鏃ユ湡:{keepCount:x, payTotal:x, payCnt:x, firstPayCnt:x}} ...}}
  * @param array &$fistPayReportArray {棣栧厖鏃ユ湡:{缁熻鏃ユ湡:{keepCount:x}} ...}}
  */
 function GetAccountFirstLoginPayReport($Channel, $fromYMD, $toYMD, &$fistLoginReportArray, &$fistPayReportArray)
 {
 	CheckAndExportFirstKeepReport($Channel); // 姣忔鑾峰彇妫�鏌ュ鍑�
 	$find = array("Channel" => $Channel, "CreateYMD" => array('$gte' => $fromYMD, '$lte' => $toYMD));
-	\DBOper\Find("AccountFirstLoginReport", $find, $newUserRetArray, array("CreateYMD" => 1, "ReportYMD" => 1, "KeepCount" => 1, "PayTotal" => 1));
+	\DBOper\Find("AccountFirstLoginReport", $find, $newUserRetArray);
 	if (!isset($newUserRetArray)) {
 		$newUserRetArray = array();
 	}
@@ -766,7 +791,10 @@
 			$fistLoginReportArray[$FirstLoginYMD] = array();
 		}
 		$statYMDInfo = $fistLoginReportArray[$FirstLoginYMD];
-		$statYMDInfo[$ReportYMD] = array("keepCount" => $info["KeepCount"], "payTotal" => $info["PayTotal"]);
+		$statYMDInfo[$ReportYMD] = array(
+			"keepCount" => $info["KeepCount"], "payTotal" => $info["PayTotal"],
+			"payCnt" => $info["PayCnt"], "firstPayCnt" => $info["FirstPayCnt"]
+		);
 		$fistLoginReportArray[$FirstLoginYMD] = $statYMDInfo;
 	}
 	ksort($fistLoginReportArray);
diff --git a/serverrep/xpaypaycnt.php b/serverrep/xpaypaycnt.php
new file mode 100644
index 0000000..13051f0
--- /dev/null
+++ b/serverrep/xpaypaycnt.php
@@ -0,0 +1,150 @@
+<?php
+include_once "/Common/Logging.php";
+include_once "/Account/User.php";
+include_once "/language/lang.php";
+include_once "/serverrep/report.php";
+
+\Logging\CreateLogging("rep.xpaypaycnt.php");
+$Permission = \User\Permission::P_REP_XPayPaycnt;
+
+$channel = $_SESSION['spid'];
+$UserAccount = $_SESSION['UserAccount'];
+$user = new \User\User($UserAccount);
+if (!$user->HavePermission($Permission)) {
+    exit;
+}
+
+$dayList = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
+$maxDay = max($dayList);
+$startDate = array_key_exists("startDate", $_POST) ? $_POST["startDate"] : date("Y-m-d", strtotime("-7 days"));
+$startYMDTime = strtotime($startDate);
+$endDate = date("Y-m-d", strtotime("+" . ($maxDay - 1) . " days", $startYMDTime));
+
+$OrderInfo = array_key_exists("OrderInfo", $_POST) ? $_POST["OrderInfo"] : "cw.tjb.1";
+
+\Logging\LogInfo("FindDate:" . $startDate . " ~ :" . $endDate);
+
+!\DBOper\Find(
+    "PayOrder",
+    array(
+        "Channel" => $channel, "State" => 1, "PayTime" => array('$gte' => $startDate . " 00:00:00", '$lte' => $endDate . " 23:59:59"),
+    ),
+    $payRetArray,
+    array("AccountID" => 1, "PayTime" => 1, "OrderInfo" => 1),
+    array("PayTime" => 1)
+);
+
+$xPayAccountInfo = array(); // 棣栬喘绀煎寘璐﹀彿淇℃伅 {accountID:棣栬喘鏃ユ湡, ...}
+$xPayReportArray = array(); // 棣栬喘绀煎寘缁熻淇℃伅 {"棣栬喘鏃ユ湡":[{accountID:1, ...}, {"statYMD":{鍐嶆浠樿垂accountID:1, ...}, ...}], ...}
+
+foreach ($payRetArray as $payInfo) {
+    $AccountID = $payInfo["AccountID"];
+    $PayTime = $payInfo["PayTime"];
+    $statYMD = substr($PayTime, 0, 10);
+    if ($payInfo["OrderInfo"] == $OrderInfo) {
+        if (!$xPayAccountInfo[$AccountID]) {
+            $xPayAccountInfo[$AccountID] = $statYMD;
+        }
+    }
+    if (!$xPayAccountInfo[$AccountID]) {
+        // 娌¢璐繃鐨勮处鍙凤紝涓嶇粺璁¤繘鏉�
+        continue;
+    }
+
+    $xPayYMD = $xPayAccountInfo[$AccountID]; // x绀煎寘鏃ユ湡
+    if (!$xPayReportArray[$xPayYMD]) {
+        $xPayReportArray[$xPayYMD] = array(array(), array());
+    }
+    $accountInfo = $xPayReportArray[$xPayYMD][0];
+    $statYMDInfo = $xPayReportArray[$xPayYMD][1];
+
+    if ($payInfo["OrderInfo"] == $OrderInfo) {
+        $accountInfo[$AccountID] = 1;
+    } else {
+        $statAccountInfo = $statYMDInfo[$statYMD];
+        $statAccountInfo[$AccountID] = 1;
+        $statYMDInfo[$statYMD] = $statAccountInfo;
+    }
+
+    $xPayReportArray[$xPayYMD] = array($accountInfo, $statYMDInfo);
+}
+ksort($xPayReportArray);
+// \Logging\LogInfo("xPayAccountInfo:" . print_r($xPayAccountInfo, true));
+// \Logging\LogInfo("xPayReportArray:" . print_r($xPayReportArray, true));
+?>
+
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <title><?php echo \Lang\gettext("璐拱X绀煎寘鍐嶄粯浜烘暟"); ?></title>
+    <link rel="stylesheet" type="text/css" href="/css/table.css">
+    <link rel="gettext" type="application/x-po" href="../language/<?php echo \Lang\getLang(); ?>/LC_MESSAGES/<?php echo \Lang\getjspodomain(); ?>.po" />
+</head>
+
+<body>
+    <center>
+        <p><b><?php echo \Lang\gettext("璐拱X绀煎寘鍚庡啀娆′粯璐逛汉鏁�"); ?></b></P>
+    </center>
+    <form method="post">
+        <?php echo \Lang\gettext("X绀煎寘鏃ユ湡"); ?>:
+        <input type="text" name="startDate" id="startDate" onclick="new Calendar().show(this);" readonly value="<?php echo $startDate; ?>" size="8" />
+        <p />
+        X鍟嗗搧缂栧彿:
+        <input type="text" name="OrderInfo" id="OrderInfo" value="<?php echo $OrderInfo; ?>" size="8" />
+        <input type="submit" value="<?php echo \Lang\gettext("鏌ヨ"); ?>" />
+        <hr />
+        <table width="100%">
+            <?php
+            echo "<caption>銆愯喘涔癤绀煎寘鍚庡啀娆′粯璐逛汉鏁般��</caption>";
+            echo "<thead><tr>";
+            echo "<th align='center' width='75'>X绀煎寘鏃ユ湡</th>";
+            echo "<th align='center' width='55'>棣栬喘浜烘暟</th>";
+            foreach ($dayList as $day) {
+                $title = $day . "鏃ヤ汉鏁�";
+                echo "<th align='center' width='70'>" .  $title . "</th>";
+            }
+            // echo "<th align='center' width='70'>鎬讳粯璐逛汉鏁�</th>";
+            echo "</tr></thead>";
+            $curYMD = date("Y-m-d");
+            foreach ($xPayReportArray as $xPayYMD => $statInfo) {
+                if ($xPayYMD < $startDate) {
+                    continue;
+                }
+                $accountInfo = $statInfo[0];
+                $statYMDInfo = $statInfo[1];
+                $xPayUserCnt = count($accountInfo);
+                echo "<tr class='trc'>";
+                echo "<td align='center'>" . $xPayYMD . "</td>";
+                echo "<td align='center'>" . $xPayUserCnt . "</td>";
+                $xPayYMDTime = strtotime($xPayYMD);
+                foreach ($dayList as $day) {
+                    $statYMD = date("Y-m-d", strtotime("+" . ($day - 1) . " days", $xPayYMDTime));
+                    $statAccountInfo = $statYMDInfo[$statYMD] ? $statYMDInfo[$statYMD] : array();
+                    $statCnt = count($statAccountInfo);
+
+                    if ($statYMD > $curYMD) {
+                        $text = "";
+                    } else {
+                        $text = $statCnt;
+                    }
+                    echo "<td align='center' width='90'>" .  $text . "</td>";
+                }
+                echo "</tr>";
+            }
+            if (count($xPayReportArray) == 0) {
+                echo "<tr class='trc'><td>鏃犳暟鎹�</td></tr>";
+            }
+            ?>
+        </table>
+        <hr />
+    </form>
+</body>
+<script type='text/javascript' src='/language/gettext.js'></script>
+<script type='text/javascript' src="/js/calendar.js"></script>
+<script type='text/javascript' src="/js/common.js"></script>
+<script type="text/javascript">
+</script>
+
+</html>
\ No newline at end of file

--
Gitblit v1.8.0