本文整理汇总了PHP中Batches::with方法的典型用法代码示例。如果您正苦于以下问题:PHP Batches::with方法的具体用法?PHP Batches::with怎么用?PHP Batches::with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Batches
的用法示例。
在下文中一共展示了Batches::with方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: batchesByClassIdSeasonId
static function batchesByClassIdSeasonId($classId, $seasonId)
{
return Batches::with('LeadInstructors')->where('season_id', '=', $seasonId)->where('class_id', '=', $classId)->where('franchisee_id', '=', Session::get('franchiseId'))->get();
// return Batches:://where('season_id','=',$seasonId)
// ->where('class_id', '=', $classId)
// ->where('franchisee_id', '=', Session::get('franchiseId'))
// get();
//return Batches::with('Classes')->where('class_id', '=', $classId)->get();
}
示例2: attendance
public function attendance($id)
{
if (Auth::check()) {
$currentPage = "BATCHES";
$mainMenu = "COURSES_MAIN";
$studentsInBatch = StudentClasses::with('Students')->where('batch_id', '=', $id)->count();
$batch = Batches::where('id', '=', $id)->first();
$attendanceArray = BatchSchedule::getAttendanceTable($id);
$lead = Batches::with('LeadInstructors')->find($id);
$alternate = Batches::with('AlternateInstructors')->find($id);
if (isset($lead->LeadInstructors)) {
$leadInstructor = $lead->LeadInstructors->first_name . ' ' . $lead->LeadInstructors->last_name;
} else {
$leadInstructor = "";
}
if (isset($alternate->AlternateInstructors)) {
$alternateInstructor = $alternate->AlternateInstructors->first_name . ' ' . $alternate->AlternateInstructors->last_name;
} else {
$alternateInstructor = "";
}
$dataToView = array('currentPage', 'mainMenu', 'attendanceArray', 'batch', 'studentsInBatch', 'leadInstructor', 'alternateInstructor');
return View::make('pages.batches.attendance', compact($dataToView));
} else {
return Redirect::to("/");
}
}