本文整理汇总了PHP中Report::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::count方法的具体用法?PHP Report::count怎么用?PHP Report::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Report
的用法示例。
在下文中一共展示了Report::count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupReports
protected function setupReports($view)
{
$reportsCount = Cache::rememberForever('reportsCount', function () {
return Report::count();
});
$view->with('reportsCount', $reportsCount);
}
示例2: admin
private function admin()
{
$today = strtotime('today');
$month = strtotime('first day of this month');
$last30 = strtotime('-30 days');
// Users statistics
$users['today'] = number_format(User::whereGt('reg_date', $today)->count());
$users['month'] = number_format(User::whereGt('reg_date', $month)->count());
$users['last30'] = number_format(User::whereGt('reg_date', $last30)->count());
$users['total'] = number_format(User::count());
View::set('users', $users);
// Playlists statistics
$playlists['today'] = number_format(Playlist::whereGt('date', $today)->count());
$playlists['month'] = number_format(Playlist::whereGt('date', $month)->count());
$playlists['last30'] = number_format(Playlist::whereGt('date', $last30)->count());
$playlists['total'] = number_format(Playlist::count());
View::set('playlists', $playlists);
// Tracks statistics
$tracks = number_format(Track::count());
View::set('tracks', $tracks);
// Tags statistics
$tags = number_format(Tag::count());
View::set('tags', $tags);
// Comments statistics
$comments = number_format(Comment::count());
View::set('comments', $comments);
// Likes
$likes = number_format(PlaylistLike::count());
View::set('likes', $likes);
// Reports
$reports = number_format(Report::count());
View::set('reports', $reports);
View::show('admin/admin');
}
示例3: header
*
* @copyright Copyright (c) Szilard Szabo
* @license GPL v3
* @package Admin
*/
include "./include/common.php";
include "Pager/Pager.php";
if (!User::is_logged_in() || User::get_id() != 1) {
header('Location: index.php');
exit;
}
if (isset($_GET['d'])) {
$d = (int) $_GET['d'];
Report::delete($d);
}
$tct = Report::count();
//total count
$rpp = 10;
//row per page
$pager_options = array('mode' => 'Sliding', 'perPage' => $rpp, 'delta' => 2, 'totalItems' => $tct, 'excludeVars' => array('o', 'r', 'd', 't', 'e'));
$pager = @Pager::factory($pager_options);
list($from, $to) = $pager->getOffsetByPageId();
$reports = Report::get_all(array(), '', $from - 1 . ", {$rpp}");
include "page-header.php";
?>
<div id="wrapper">
<?php
include "page-left.php";
?>