本文整理汇总了PHP中Batches::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Batches::count方法的具体用法?PHP Batches::count怎么用?PHP Batches::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Batches
的用法示例。
在下文中一共展示了Batches::count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBatchID
static function getBatchID($courseId, $classId, $startYear, $startMonth, $seasonId)
{
if (Batches::count()) {
$batchCount = Batches::where("class_id", "=", $classId)->where('season_id', '=', $seasonId)->count() + 1;
} else {
$batchCount = 1;
}
if ($batchCount < 10) {
$batchCount = str_pad($batchCount, 2, '0', STR_PAD_LEFT);
}
$courseSlug = Courses::select("slug")->where("id", "=", $courseId)->get();
$classSlug = Classes::select("slug")->where("id", "=", $classId)->get();
$yearSlug = date("Y", strtotime($startYear));
$monthSlug = date("M", strtotime($startYear));
$batchSlug = $courseSlug['0']->slug . '-' . $classSlug['0']->slug . '-' . strtoupper($monthSlug) . '-' . $yearSlug . '-' . $batchCount;
//print_r($classSlug['0']->slug);
return $batchSlug;
}