当前位置: 首页>>代码示例>>PHP>>正文


PHP Stats::getActivePvpStats方法代码示例

本文整理汇总了PHP中Stats::getActivePvpStats方法的典型用法代码示例。如果您正苦于以下问题:PHP Stats::getActivePvpStats方法的具体用法?PHP Stats::getActivePvpStats怎么用?PHP Stats::getActivePvpStats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stats的用法示例。


在下文中一共展示了Stats::getActivePvpStats方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: date

$prevRanks = $mdb->findDoc('ranksProgress', ['cacheTime' => 36000, 'type' => $statType, 'id' => (int) $id], ['date' => 1]);
if ($prevRanks != null && isset($prevRanks['date']->sec)) {
    $prevRanks['date'] = date('Y-m-d', $prevRanks['date']->sec);
    $statistics['prevRanks'] = $prevRanks;
}
$groups = @$statistics['groups'];
if (is_array($groups) and sizeof($groups) > 0) {
    Info::addInfo($groups);
    $g = [];
    foreach ($groups as $group) {
        $g[$group['groupName']] = $group;
    }
    ksort($g);
    // Divide the stats into 4 columns...
    $chunkSize = ceil(sizeof($g) / 4);
    $statistics['groups'] = array_chunk($g, $chunkSize);
} else {
    $statistics['groups'] = null;
}
$months = @$statistics['months'];
// Ensure the months are sorted in descending order
if (is_array($months) && sizeof($months) > 0) {
    krsort($months);
    $statistics['months'] = array_values($months);
} else {
    $statistics['months'] = null;
}
// Collect active PVP stats
$activePvP = Stats::getActivePvpStats($parameters);
$renderParams = array('pageName' => $pageName, 'kills' => $kills, 'losses' => $losses, 'detail' => $detail, 'page' => $page, 'topKills' => $topKills, 'mixed' => $mixedKills, 'key' => $key, 'id' => $id, 'pageType' => $pageType, 'solo' => $solo, 'topLists' => $topLists, 'corps' => $corpList, 'corpStats' => $corpStats, 'summaryTable' => $stats, 'pager' => sizeof($kills) + sizeof($losses) >= $limit, 'datepicker' => true, 'nextApiCheck' => $nextApiCheck, 'apiVerified' => $apiVerified, 'prevID' => $prevID, 'nextID' => $nextID, 'extra' => $extra, 'statistics' => $statistics, 'activePvP' => $activePvP);
$app->render('overview.html', $renderParams);
开发者ID:WreckerWorld,项目名称:zKillboard,代码行数:31,代码来源:overview.php

示例2: unset

<?php

global $mdb;
try {
    $parameters = Util::convertUriToParameters();
    $array = $mdb->findDoc('statistics', ['type' => $type, 'id' => (int) $id]);
    unset($array['_id']);
    $array['activepvp'] = Stats::getActivePvpStats($parameters);
    $array['info'] = $mdb->findDoc('information', ['type' => $type, 'id' => (int) $id]);
    unset($array['info']['_id']);
    //Stats::getSupers($array, $type, $id);
    header('Access-Control-Allow-Origin: *');
    header('Access-Control-Allow-Methods: GET');
    if (isset($_GET['callback']) && Util::isValidCallback($_GET['callback'])) {
        $app->contentType('application/javascript; charset=utf-8');
        header('X-JSONP: true');
        echo $_GET['callback'] . '(' . json_encode($array) . ')';
    } else {
        $app->contentType('application/json; charset=utf-8');
        if (isset($parameters['pretty'])) {
            echo json_encode($array, JSON_PRETTY_PRINT);
        } else {
            echo json_encode($array);
        }
    }
} catch (Exception $ex) {
    header('HTTP/1.0 503 Server error.');
    die;
}
开发者ID:hybrid1969,项目名称:zKillboard,代码行数:29,代码来源:apistats.php


注:本文中的Stats::getActivePvpStats方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。