本文整理汇总了PHP中Student::whereIn方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::whereIn方法的具体用法?PHP Student::whereIn怎么用?PHP Student::whereIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student::whereIn方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showAllAssignmentView
public function showAllAssignmentView()
{
if (!is_null(Input::get('group_code'))) {
Session::put('group_code', Input::get('group_code'));
}
if (Session::has('group_code')) {
$group = Group::find(new MongoId(Session::get('group_code')));
$students = Student::whereIn('_id', $group->students_id)->get();
return View::make('student.show_all_assignment')->with(array('group' => $group, 'assignments' => $this->evaluateAssignments($group->_id), 'students' => $students));
} else {
return Redirect::to(Lang::get('routes.student'));
}
}
示例2: search
public static function search($search_text, $search_state, $search_level)
{
$first_filter = Student::where('names', 'LIKE', "%{$search_text}%")->orWhere('lastname', 'LIKE', "%{$search_text}%")->whereNull('deleted_at');
//if($search_state=='T') return $first_filter;
$students = $first_filter->get();
$second_filter = [];
foreach ($students as $student) {
$enrollment = $student->getCurrentEnrollment();
if ($enrollment) {
if ($search_state == 'T' || $search_state == $enrollment->state) {
if ($search_level == '0' || $search_level == $enrollment->level_id) {
$second_filter[] = $student->id;
}
}
} else {
if ($search_state == 'T' || $search_state == 'N') {
if ($search_level == '0' || $search_level == $student->getLevelToEnroll()->id) {
$second_filter[] = $student->id;
}
}
}
}
return Student::whereIn('id', $second_filter);
}
示例3:
<a href="#" id="{{$group->_id}}" class="group_name" style="text-transform: none; color: white;">{{$group->name}}</a></div>
<?php
$sectionCode = SectionCode::find($group->section_code_id);
$subject = Subject::find($sectionCode->subject_id);
$section = $subject->sections()->find($sectionCode->section_id);
$name = $subject->name . ' - ' . $section->code;
?>
<div>
<span style="text-transform: uppercase;">{{$name}}</span>
</div>
</div>
</div>
</div>
<div class="panel-footer" style="color: #000000;">
<?php
$students = Student::whereIn('_id', $group->students_id)->get();
?>
@foreach ($students as $user)
@if(strcmp($group->teamleader_id, $user->_id) === 0)
{{$user->name.' '.$user->last_name.' ('.Lang::get('teamleader.tm').')'}}
@else
{{$user->name.' '.$user->last_name}}
@endif
<a onclick="fillModal('{{$user->_id}}')" href="#" data-toggle="modal" data-target="#studentDetailsModal">
<i class="fa fa-external-link"></i></a>
<br>
@endforeach
{{ Form::open(array('url' => Lang::get('routes.show_all_assignment'), 'id' => 'form_group')) }}
<div class="form-group">
<input type="hidden" id="group_code", name="group_code" value="">
</div>
示例4: MongoId
<thead>
<tr>
<th>#</th>
<th>{{Lang::get('list_section.section')}}</th>
<th>{{Lang::get('teamleader.section_code')}}</th>
<th>{{Lang::get('teamleader.tm')}}</th>
<th>{{Lang::get('list_subject.delete')}}</th>
</tr>
</thead>
<tbody>
<?php
$sectionCodes = SectionCode::where('subject_id', new MongoId($subject->_id))->get();
?>
@foreach ($sectionCodes as $sectionCode)
<?php
$students = Student::whereIn('_id', $sectionCode->teamleaders_id)->get();
?>
@foreach ($students as $index => $student)
<?php
$section = $subject->sections()->find($sectionCode->section_id);
?>
<tr id="{{$item.'_'.$index}}">
<td>{{$index + 1}}</td>
<td>{{$section->code}}</td>
<td>{{$sectionCode->code}}</td>
<td>{{'('.$student->id_number.') - '.$student->name.' '.$student->last_name}}</td>
<td style="width: 6%">
<button type="button" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#deleteModal" onclick="fillModal('{{$item.'_'.$index}}', '{{$sectionCode->_id}}', '{{$student->_id}}')">
{{Lang::get('list_subject.delete')}}
</button>
</td>
示例5: getFarmReport
public function getFarmReport()
{
$group_id = Input::get('group_id');
$group = Group::where('_id', new MongoId($group_id))->first();
$students = Student::whereIn('_id', $group->students_id)->get();
$total_assignments = Assignment::where('group_id', new MongoId($group_id))->count();
$total_completed = Assignment::where('group_id', new MongoId($group_id))->where('state', 'c')->count();
$total_incompleted = Assignment::where('group_id', new MongoId($group_id))->whereIn('state', array('n', 'nc'))->count();
$total_pending = Assignment::where('group_id', new MongoId($group_id))->whereIn('state', array('a', 'r', 'p'))->count();
$student_task = TeacherController::getStatStudents($group->students_id, $group_id);
$assignments = Assignment::where('group_id', new MongoId($group_id))->get();
return View::make('teacher.farm_report')->with(array('students' => $students, 'total_assignments' => $total_assignments, 'total_completed' => $total_completed, 'total_incompleted' => $total_incompleted, 'total_pending' => $total_pending, 'student_task' => $student_task, 'colors' => $this->colors, 'assignments' => $assignments, 'group' => $group));
}
示例6: find
public function find()
{
if (Request::ajax()) {
if (!is_null(Input::get('section')) && !is_null(Input::get('subject'))) {
$section = Subject::find(Input::get('subject'))->sections()->find(Input::get('section'));
if (isset($section->current_code)) {
$sectionCode = SectionCode::where('code', $section->current_code)->first();
$students = Student::whereIn('_id', $sectionCode->students_id)->whereNotIn('_id', $sectionCode->teamleaders_id)->orderBy('id_number', 'asc')->get();
$code = count($students) > 0 ? '00' : '99';
return Response::json(array('students' => $students, 'code' => $code));
} else {
return Response::json("");
}
} else {
if (!is_null(Input::get('group_id'))) {
$group = Group::find(Input::get('group_id'));
$students = Student::whereIn('_id', $group->students_id)->get();
return Response::json($students);
} else {
if (!is_null(Input::get('id'))) {
return Response::json(Student::find(Input::get('id')));
}
}
}
}
}