当前位置: 首页>>代码示例>>PHP>>正文


PHP Student::whereIn方法代码示例

本文整理汇总了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'));
     }
 }
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:13,代码来源:AssignmentController.php

示例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);
 }
开发者ID:damv93,项目名称:trecedemayolaravel,代码行数:24,代码来源:Student.php

示例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>
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:31,代码来源:show_all_group.blade.php

示例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>
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:31,代码来源:show_all_teamleader.blade.php

示例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));
 }
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:13,代码来源:GroupController.php

示例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')));
                 }
             }
         }
     }
 }
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:26,代码来源:StudentController.php


注:本文中的Student::whereIn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。