本文整理汇总了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>