本文整理匯總了PHP中app\Activity::count方法的典型用法代碼示例。如果您正苦於以下問題:PHP Activity::count方法的具體用法?PHP Activity::count怎麽用?PHP Activity::count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\Activity
的用法示例。
在下文中一共展示了Activity::count方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getList
public function getList(Request $request, $type = 'all')
{
$perpage = 20;
$activitys = Activity::orderBy('activity_sort', 'ASC');
$allCount = Activity::count();
$onlineCount = Activity::where('activity_active', '=', '1')->count();
$offlineCount = Activity::where('activity_active', '=', '0')->count();
if ($type == 'online') {
$activitys = $activitys->where('activity_active', '=', '1');
} elseif ($type == 'offline') {
$activitys = $activitys->where('activity_active', '=', '0');
}
$activitys = $activitys->paginate($perpage);
session(['previousUrl' => URL::full()]);
return view('manage.activity.list', ['TITLE' => '活動列表', 'META_KEYWORDS' => META_KEYWORDS, 'META_DESC' => META_DESC, 'PAGE_CODE' => '/manage/activity/list', 'type' => $type, 'activitys' => $activitys, 'allCount' => $allCount, 'onlineCount' => $onlineCount, 'offlineCount' => $offlineCount]);
}
示例2: getCount
public function getCount()
{
return \App\Activity::count();
}