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


PHP helper::getCount方法代码示例

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


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

示例1: reset

 private function reset()
 {
     $this->_set('limit', 50);
     $this->_def('limitstart', 0);
     $query = 'SELECT remote_ip ' . 'FROM raw_log ' . 'GROUP BY remote_ip';
     $this->gates = F::$dbo->fetch($query, 'remote_ip');
     $this->_set('gate', isset($_GET['gate']) ? $_GET['gate'] : reset($this->gates));
     $this->categories = helper::getCount('raw_log', 'cat_name', $this->_get('gate'));
     $this->_set('category', isset($_GET['category']) ? $_GET['category'] : '');
 }
开发者ID:EsterniTY,项目名称:dfl860e-logger,代码行数:10,代码来源:request.php

示例2: array

<?php

$highlight = array();
$events = helper::getCount('cat_conn', 'event');
$rules = helper::getCount('cat_conn', 'rule');
$proto = helper::getCount('cat_conn', 'connipproto');
helper::fixFilterLabels($proto);
$select = array();
$from = "FROM cat_conn\n";
$where = array();
$group = array();
if (R::_('connsrcip') && R::_('connsrcip-group')) {
    $select[] = '*';
    $select[] = 'sum(origsent) AS origsent';
    $select[] = 'sum(termsent) AS termsent';
    $select[] = 'sum(conntime) AS conntime';
}
helper::processFilterSimple($where, 'remote_ip', R::_('gate'));
helper::processFilterSimple($where, 'event', R::_('event'));
helper::processFilterSimple($where, 'rule', R::_('rule'));
helper::processFilterCanBeEmpty($where, 'connipproto', R::_('proto'));
helper::processFilterCanBeEmpty($where, 'connsrcip', R::_('connsrcip'));
if (R::_('connsrcip-group')) {
    $select[] = 'count(id) AS cnt';
    $group[] = 'conndestip';
}
helper::processFilterDefault($where);
helper::processFilterFreeText($where, R::_('free_text'), $highlight);
$select = 'SELECT' . (!empty($select) ? "\n " . implode(",\n ", $select) : ' *') . "\n";
$where = !empty($where) ? "WHERE " . implode("\nAND ", $where) . "\n" : '';
$group = !empty($group) ? "GROUP BY " . implode(' ', $group) . "\n" : '';
开发者ID:EsterniTY,项目名称:dfl860e-logger,代码行数:31,代码来源:conn.php

示例3: array

<?php

$highlight = array();
$events = helper::getCount('cat_rule', 'event');
$rules = helper::getCount('cat_rule', 'rule');
$actions = helper::getCount('cat_rule', 'action');
$proto = helper::getCount('cat_rule', 'ipproto');
helper::fixFilterLabels($proto);
$select = array('*');
$from = "FROM cat_rule\n";
$where = array();
$group = array();
helper::processFilterSimple($where, 'remote_ip', R::_('gate'));
helper::processFilterSimple($where, 'event', R::_('event'));
helper::processFilterSimple($where, 'action', R::_('action'));
helper::processFilterSimple($where, 'rule', R::_('rule'));
helper::processFilterCanBeEmpty($where, 'ipproto', R::_('proto'));
helper::processFilterCanBeEmpty($where, 'srcip', R::_('srcip'));
helper::processFilterCanBeEmpty($where, 'destip', R::_('destip'));
if (R::_('srcip-group')) {
    $select[] = 'count(id) AS cnt';
    $group[] = 'destip';
}
helper::processFilterDefault($where);
helper::processFilterFreeText($where, R::_('free_text'), $highlight);
$select = 'SELECT' . (!empty($select) ? "\n " . implode(",\n ", $select) : ' *') . "\n";
$where = !empty($where) ? "WHERE " . implode("\nAND ", $where) . "\n" : '';
$group = !empty($group) ? "GROUP BY " . implode(' ', $group) . "\n" : '';
$rows = F::$dbo->fetchLimited($select . $from . $where . $group);
$group = !empty($group) ? $group : "GROUP BY id\n";
$q = F::$dbo->query('SELECT COUNT(id),min(datetime),max(datetime) FROM (SELECT id,datetime ' . $from . $where . $group . ') AS rows');
开发者ID:EsterniTY,项目名称:dfl860e-logger,代码行数:31,代码来源:rule.php


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