本文整理汇总了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'] : '');
}
示例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" : '';
示例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');