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


PHP Department::orderBy方法代码示例

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


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

示例1: create

 /**
  * Show the form for creating a new resource.
  * GET /users/create
  *
  * @return Response
  */
 public function create()
 {
     $pagetitle = 'Create User';
     $departments = Department::orderBy('department')->lists('department', 'id');
     $roles = Role::orderBy('name')->lists('name', 'id');
     return View::make('user.create', compact('pagetitle', 'departments', 'roles'));
 }
开发者ID:jcyanga28,项目名称:project-reference,代码行数:13,代码来源:UsersController.php

示例2: getList

 /**
  * Get all departments ordered by department name with results paginated 
  *
  * @return Department
  */
 public function getList()
 {
     return Department::orderBy('department_name')->paginate(5);
 }
开发者ID:cmd0315,项目名称:online-forms,代码行数:9,代码来源:DepartmentRepository.php

示例3: index

 public function index()
 {
     Auth::isAdminOrDie(App::$instance);
     $departments = Department::orderBy('prefix')->get();
     $this->render('departments/index', compact('departments'));
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:6,代码来源:Departments_controller.php

示例4: joinCaCreate

 public function joinCaCreate($referral = false)
 {
     Token::checkToken();
     $request = $this->request->request;
     if ($referral) {
         $request->set('referrer', $referral);
     }
     $this->validator->validate(['Приглашение от ЦА' => [$request->get('referrer'), 'required']]);
     //if no passes
     if (!$this->validator->passes()) {
         App::$instance->MQ->setMessage($this->validator->errors()->all());
         ST::redirect("back");
     }
     //check codes
     $caWS = CAVks::where('referral', $request->get('referrer'))->with('owner', 'connection_codes', 'insideParp', 'phoneParp', 'outsideParp')->first();
     $caNS = CAVksNoSupport::where('referral', $request->get('referrer'))->first();
     if (!$caWS && !$caNS) {
         App::$instance->MQ->setMessage("Приглашение {$request->get('referrer')}  не действительно");
         ST::redirectToRoute("Vks/select");
     }
     $caVks = $caWS ? $caWS : $caNS;
     $this->convertToLocalTime($caVks);
     $valid = true;
     if (isset($caVks->status)) {
         if (!in_array($caVks->status, [VKS_STATUS_APPROVED, VKS_STATUS_TRANSPORT_FOR_TB])) {
             $valid = false;
         }
     } else {
         if (!in_array($caVks->status, [VKS_STATUS_APPROVED, VKS_STATUS_TRANSPORT_FOR_TB])) {
             $valid = false;
         }
     }
     if (!$valid) {
         App::$instance->MQ->setMessage("Приглашение {$request->get('referrer')}  не действительно, в ЦА поменяли статус этой ВКС и теперь она недоступна");
         ST::redirectToRoute("Vks/select");
     }
     //my tb is can be accepted?
     $participants = isset($caVks->insideParp) ? $caVks->insideParp : $caVks->participants;
     $flag = false;
     foreach ($participants as $parp) {
         if ($parp->attendance_id == App::$instance->tbId) {
             $flag = true;
         }
     }
     $referral = $request->get('referrer');
     if ($this->isAlreadyEnd(date_create($caVks->end_date_time))) {
         App::$instance->MQ->setMessage("Приглашение {$request->get('referrer')}  не действительно, ВКС уже закончилась", 'danger');
         ST::redirectToRoute("Vks/select");
     }
     if (!$flag && $caVks->local->start_date_time->getTimestamp() - date_create()->getTimestamp() < 1800) {
         App::$instance->MQ->setMessage("Ваш ТБ не заявлен на эту ВКС и до начала ВКС осталось менее 30 минут, заявиться на такую ВКС уже не получится, обратитесь к администратору системы", 'danger');
         ST::redirectToRoute("Vks/select");
     }
     $departments = Department::orderBy('prefix')->get();
     $vks = ST::lookAtBackPack();
     $vks = $vks->request;
     if (!$vks->has('inner_participants') && !count($vks->get('inner_participants'))) {
         LocalStorage_controller::staticRemove('vks_participants_create');
     }
     $available_points = Attendance::techSupportable()->get()->toArray();
     array_walk($available_points, function (&$e) {
         $e['selectable'] = true;
     });
     $this->render('vks/joinCa', compact('vks', 'caVks', 'departments', 'referral', 'flag', 'available_points'));
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:65,代码来源:Vks_controller.php


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