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


PHP Teacher::orderBy方法代码示例

本文整理汇总了PHP中Teacher::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Teacher::orderBy方法的具体用法?PHP Teacher::orderBy怎么用?PHP Teacher::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Teacher的用法示例。


在下文中一共展示了Teacher::orderBy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getTeacherSelectArray

 public static function getTeacherSelectArray()
 {
     if (self::$teacherSelectArrayCache == null) {
         $teacherSelectArray[0] = '無';
         $teacher = Teacher::orderBy('teacher_name')->with('classes')->get();
         foreach ($teacher as $teacherItem) {
             $string = $teacherItem->teacher_name;
             if ($teacherItem->classes != null) {
                 $string .= '(' . $teacherItem->classes->classes_name . ')';
             }
             $teacherSelectArray[$teacherItem->teacher_id] = $string;
         }
         self::$teacherSelectArrayCache = $teacherSelectArray;
         return $teacherSelectArray;
     } else {
         return self::$teacherSelectArrayCache;
     }
 }
开发者ID:ramazanalic,项目名称:open-school-timetable,代码行数:18,代码来源:Teacher.php

示例2: list_teachers

 public function list_teachers()
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         $data["actions"] = Session::get('actions');
         if (in_array('side_listar_profesores', $data["actions"])) {
             $data["search"] = null;
             $data["teachers_data"] = Teacher::orderBy('lastname')->paginate(20);
             return View::make('people/list_teachers', $data);
         } else {
             // Llamo a la función para registrar el log de auditoria
             $log_description = "Se intentó acceder a la ruta '" . Request::path() . "' por el método '" . Request::method() . "'";
             Helpers::registerLog(10, $log_description);
             Session::flash('error', 'Usted no tiene permisos para realizar dicha acción.');
             return Redirect::to('/dashboard');
         }
     } else {
         return View::make('error/error');
     }
 }
开发者ID:damv93,项目名称:trecedemayolaravel,代码行数:21,代码来源:PeopleController.php

示例3: function

     return View::make('timetable')->with($viewData);
 });
 // 顯示教師排課清單
 Route::get('view_title/{titleId}/{teacherId}', function ($titleId, $teacherId) {
     $teacherList = $titleId == 'all' ? Teacher::orderBy('teacher_name') : Teacher::where('title_id', '=', $titleId)->orderBy('teacher_name');
     $viewData['teacherList'] = $teacherList->get();
     $viewData['titleList'] = Title::orderBy('title_name')->get();
     $viewData['titleId'] = $titleId;
     $viewData['teacher'] = Teacher::find($teacherId);
     $viewData['teacherId'] = $teacherId;
     $viewData['courseUnits'] = $viewData['teacher']->courseunit;
     return View::make('timetable')->with($viewData);
 });
 // 顯示教師排課編輯畫面
 Route::get('view_title/{titleId}/{teacherId}/{courseUnitId}', function ($titleId, $teacherId, $courseUnitId) {
     $teacherList = $titleId == 'all' ? Teacher::orderBy('teacher_name') : Teacher::where('title_id', '=', $titleId)->orderBy('teacher_name');
     $viewData['teacherList'] = $teacherList->get();
     $viewData['titleList'] = Title::orderBy('title_name')->get();
     $viewData['titleId'] = $titleId;
     $viewData['teacher'] = Teacher::find($teacherId);
     $viewData['teacherId'] = $teacherId;
     $viewData['courseUnits'] = $viewData['teacher']->courseunit;
     $viewData['courseUnit'] = Courseunit::find($courseUnitId);
     return View::make('timetable')->with($viewData);
 });
 // 執行更新排課設定
 Route::post('edit/{titleId}/{teacherId}/{courseUnitId}', function ($titleId, $teacherId, $courseUnitId) {
     // 設定為編輯模式,方便驗證功能
     $validator = FormValidator::courseUnit(array_merge(Input::all(), array('mode' => 'edit' . $courseUnitId)));
     if ($validator->fails()) {
         return Redirect::to('/timetable/view_title/' . $titleId . '/' . $teacherId . '/' . $courseUnitId)->withInput()->withErrors($validator)->with('message', '輸入錯誤,請檢查');
开发者ID:ramazanalic,项目名称:open-school-timetable,代码行数:31,代码来源:routes.php

示例4: edit_course

 public function edit_course($id = null)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         $data["actions"] = Session::get('actions');
         if (in_array('side_nuevo_curso', $data["actions"]) && $id) {
             $data["course_info"] = Course::find($id);
             if (!$data["course_info"]) {
                 Session::flash('error', 'No se encontró el Curso solicitado.');
                 return Redirect::to('levels/list_levels');
             }
             $teachers = Teacher::orderBy('lastname')->get();
             $data["teachers"] = $teachers->lists('FullName', 'id');
             return View::make('levels/edit_course', $data);
         } else {
             // Llamo a la función para registrar el log de auditoria
             $log_description = "Se intentó acceder a la ruta '" . Request::path() . "' por el método '" . Request::method() . "'";
             Helpers::registerLog(10, $log_description);
             Session::flash('error', 'Usted no tiene permisos para realizar dicha acción.');
             return Redirect::to('/dashboard');
         }
     } else {
         return View::make('error/error');
     }
 }
开发者ID:damv93,项目名称:trecedemayolaravel,代码行数:26,代码来源:LevelController.php


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