HavePermission($Permission)) { exit; } CommFunc\GetConfig("ServerInfo", "CoupontypeGroup", $CoupontypeGroup); $CoupontypeGroup = json_decode($CoupontypeGroup, true); if (!isset($CoupontypeGroup)) { echo "分组专用,没有配置分组信息"; exit; } \CommFunc\GetConfig("ServerInfo", "SpecialServerIDStart", $SpecialServerIDStart); $SpecialServerIDStart = intval($SpecialServerIDStart); if (!$SpecialServerIDStart || $SpecialServerIDStart <= 0) { echo "特殊公会区服专用,未配置SpecialServerIDStart"; exit; } $startDate = array_key_exists("startDate", $_POST) ? $_POST["startDate"] : \CommFunc\CalcToStrDateTime("-7 days", "Y-m-d"); $endDate = array_key_exists("endDate", $_POST) ? $_POST["endDate"] : date("Y-m-d"); // 只显示成功的订单; 1-成功;2-失败 $match = array( "Channel" => $spid, "State" => 1, "ServerID" => array('$gte' => $SpecialServerIDStart), "PayTime" => array('$gte' => $startDate . " 00:00:00", '$lte' => $endDate . " 23:59:59") ); $ret = \DBOper\Aggregate("PayOrder", array( array( '$match' => $match, ), array( '$group' => array( '_id' => array('ServerID' => '$ServerID', 'AccountID' => '$AccountID'), 'total' => array('$sum' => '$OrderAmount'), ), ), ), $retInfo); $payGroupInfo = array(); if (isset($retInfo)) { foreach ($retInfo as $info) { $_idInfo = $info["_id"]; $AccountID = $_idInfo["AccountID"]; $ServerID = $_idInfo["ServerID"]; $accountPayTotal = $info["total"]; $Coupontype = \DataMgr\GetCoupontypeGroup($spid, $AccountID, $ServerID); $GroupName = array_key_exists($Coupontype, $CoupontypeGroup) ? $CoupontypeGroup[$Coupontype] : ""; if (!$payGroupInfo[$GroupName]) { $payGroupInfo[$GroupName] = array(); } $groupInfo = $payGroupInfo[$GroupName]; $groupInfo["payTotal"] = ($groupInfo["payTotal"] ? $groupInfo["payTotal"] : 0) + $accountPayTotal; $payGroupInfo[$GroupName] = $groupInfo; } } //显示表格字段配置 key-参数名,value-说明 $tableArray = array( "GroupName" => array(\Lang\gettext("分组"), "10%", "center"), "payTotal" => array(\Lang\gettext("总充值"), "10%", "center"), ); ?> <?php echo \Lang\gettext("充值分组"); ?>


: ~ " class="button green medium" />
"; foreach ($tableArray as $value) { echo ""; } else { echo \Lang\gettext("暂无数据"), "
"; } $Num = $skip; $roleInfoArray = array(); foreach ($payGroupInfo as $GroupName => $info) { $Num += 1; echo ""; foreach ($tableArray as $key => $value) { $tdContent = $info[$key]; if ($key == "Num") { $tdContent = $Num; } elseif ($key == "GroupName") { $tdContent = $GroupName; } elseif ($key == "payTotal") { $tdContent = round($tdContent, 2); } echo ""; } echo ""; } ?>
" . $value[0] . ""; } echo "
"; echo "
" . $tdContent . "
"; echo "