本文整理匯總了PHP中Subject::whereIn方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subject::whereIn方法的具體用法?PHP Subject::whereIn怎麽用?PHP Subject::whereIn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Subject
的用法示例。
在下文中一共展示了Subject::whereIn方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: showAllSectionsCodesView
public function showAllSectionsCodesView()
{
$teacher = Teacher::find(Auth::id());
$subjects = Subject::whereIn('_id', $teacher->subjects_id)->get();
$section_codes = SectionCode::where('teacher_id', new MongoId($teacher->_id))->where('status', true)->get();
return View::make('teacher.section_codes')->with(array('subjects' => $subjects, 'teacher_section_id' => $teacher->sections_id, 'section_codes' => $section_codes));
}
示例2:
@extends('university.master')
@section('title', Lang::get('university_title.show_enroll'))
@section('content')
<div class="row">
<div class="col-lg-12">
<h1 class="page-header"><i class="fa fa-compress"></i> {{Lang::get('list_enroll.enrollment')}}</h1>
<div class="panel-body">
@if (count($teachers) > 0)
<div class="table-responsive">
@foreach($teachers as $a => $teacher)
<?php
$subjects = Subject::whereIn('_id', $teacher->subjects_id)->get();
?>
@if(count($subjects) > 0)
@if(is_null($teacher->profile_image))
<img src="images/140x140.png" alt="profesor"></td>
@else
<img src="{{Lang::get('show_image').'?src='.storage_path().$teacher->profile_image}}"/>
@endif
<h3>{{$teacher->name.' '.$teacher->last_name}}</h3><br />
@foreach($subjects as $b => $subject)
<h4>{{Lang::get('list_enroll.subject').$subject->name}}</h4>
<table id="tableOrder" class="table table-striped table-bordered table-hover tablesorter">
<thead>
<tr>
<th>#</th>
<th>{{Lang::get('list_enroll.section')}}</th>
<th>{{Lang::get('list_enroll.school')}}</th>
<th>{{Lang::get('list_enroll.unlink')}}</th>