10162 后台优化(修复新增充值用户充值统计错误;修复首充用户留存计算错误;)
3个文件已修改
41 ■■■■ 已修改文件
serverrep/ImportAccountLoginpay.php 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
serverrep/keeplogin.php 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
serverrep/report.php 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
serverrep/ImportAccountLoginpay.php
@@ -51,9 +51,9 @@
    logweb("AccountDayActiveOK:" . $AccountDayActiveOK);
    impAccountDayActive("json");
}
if (!$opt || $opt == "rep" || $opt == "reDayActive") {
if (!$opt || $opt == "rep" || $opt == "rerep" || $opt == "reDayActive") {
    logweb("开始导出每日报表:" . $Channel);
    if ($opt == "reDayActive") {
    if ($opt == "rerep" || $opt == "reDayActive") {
        $DailyReportOK = \DBOper\Remove("DailyReport", array("Channel" => $Channel));
        $AccountFirstLoginReportOK = \DBOper\Remove("AccountFirstLoginReport", array("Channel" => $Channel));
        $AccountFirstPayReportOK = \DBOper\Remove("AccountFirstPayReport", array("Channel" => $Channel));
serverrep/keeplogin.php
@@ -127,7 +127,7 @@
                $firstYMDTime = strtotime($firstYMD);
                $firstCount = 0;
                foreach ($dayList as $day) {
                    $statYMD = date("Y-m-d", strtotime("+" . $day . " days", $firstYMDTime));
                    $statYMD = date("Y-m-d", strtotime("+" . ($day - 1) . " days", $firstYMDTime));
                    if ($day == 1) {
                        $statInfo = $statYMDInfo[$firstYMD] ? $statYMDInfo[$firstYMD] : array();
                        $firstCount = $statInfo["keepCount"] ? $statInfo["keepCount"] : 0;
serverrep/report.php
@@ -92,26 +92,14 @@
    $DNU = \DBOper\Count("AccountFirstLogin", array("Channel" => $Channel, "CreateYMD" => $YMD));
    \Logging\LogInfo(" 日新增用户数 DNU:" . $DNU);
    $DNPU = \DBOper\Count("AccountFirstPay", array("Channel" => $Channel, "PayYMD" => $YMD));
    \Logging\LogInfo(" 日新增充值用户数 DNPU:" . $DNPU);
    $ret = \DBOper\Aggregate("AccountFirstPay", array(
        array(
            '$match' => array("Channel" => $Channel, "PayYMD" => $YMD),
        ),
        array(
            '$group' => array(
                '_id' => null,
                'total' => array('$sum' => '$OrderAmount'),
            ),
        )
    ), $retInfo);
    $DRNPU = 0;
    if ($ret && isset($retInfo) && count($retInfo) > 0) {
        $DRNPU = $retInfo[0]["total"];
    \DBOper\Find("AccountFirstPay", array("Channel" => $Channel, "PayYMD" => $YMD), $ret, array("AccountID" => 1));
    $firstPayAccountIDInfo = array();
    if (isset($ret)) {
        foreach ($ret as $firstPayInfo) {
            $AccountID = $firstPayInfo["AccountID"];
            $firstPayAccountIDInfo[$AccountID] = 1;
        }
    }
    $DRNPU = round($DRNPU, 2);
    \Logging\LogInfo(" 日新增充值用户充值总额 DRNPU:" . $DRNPU);
    $ret = \DBOper\Aggregate("PayOrder", array(
        array(
@@ -129,13 +117,22 @@
    ), $retInfo);
    $DPU = 0;
    $DRPU = 0;
    $DRNPU = 0;
    if ($ret && isset($retInfo)) {
        foreach ($retInfo as $info) {
            $DPU += 1;
            $AccountID = $info["_id"]["AccountID"];
            $DRPU += $info["total"];
            if ($firstPayAccountIDInfo[$AccountID]) {
                $DRNPU += $info["total"];
            }
        }
    }
    $DRPU = round($DRPU, 2);
    $DRNPU = round($DRNPU, 2);
    $DNPU = count($firstPayAccountIDInfo);
    \Logging\LogInfo(" 日新增充值用户数 DNPU:" . $DNPU);
    \Logging\LogInfo(" 日新增充值用户充值总额 DRNPU:" . $DRNPU);
    \Logging\LogInfo(" 日充值用户数 DPU:" . $DPU);
    \Logging\LogInfo(" 日充值用户数充值总额 DRPU:" . $DRPU);