當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Driver::order_by方法代碼示例

本文整理匯總了PHP中Driver::order_by方法的典型用法代碼示例。如果您正苦於以下問題:PHP Driver::order_by方法的具體用法?PHP Driver::order_by怎麽用?PHP Driver::order_by使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Driver的用法示例。


在下文中一共展示了Driver::order_by方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_editkso

 public function get_editkso($id = false)
 {
     if (!$id) {
         Redirect::to('ksos');
     }
     $kso = Kso::find($id);
     $optionspool = array();
     foreach (Pool::all() as $pool) {
         $optionspool[$pool->id] = $pool->pool_name;
     }
     $opttipe = array();
     foreach (Ksotype::all() as $tipe) {
         $opttipe[$tipe->id] = $tipe->type;
     }
     $optionFleet = array();
     $optionFleet['null'] = '----';
     //$fleets = Fleet::where_pool_id($kso->pool_id)->order_by('taxi_number','asc')->get(array('id','taxi_number'));
     $fleets = Fleet::order_by('taxi_number', 'asc')->get(array('id', 'taxi_number'));
     if ($fleets) {
         foreach ($fleets as $fo) {
             $optionFleet[$fo->id] = $fo->taxi_number;
         }
     }
     $optionDriver = array();
     $optionDriver['null'] = '----';
     //$drivers = Driver::where_pool_id($kso->pool_id)->order_by('nip', 'asc')->get(array('id','nip','name'));
     $drivers = Driver::order_by('nip', 'asc')->get(array('id', 'nip', 'name'));
     if ($drivers) {
         foreach ($drivers as $do) {
             $optionDriver[$do->id] = $do->nip . ' - ' . $do->name;
         }
     }
     $this->data['statuskso'] = array('1' => 'Active', '2' => 'Gugur KSO', '3' => 'Selesai KSO');
     $this->data['pools'] = $optionspool;
     $this->data['kso_types'] = $opttipe;
     $this->data['datakso'] = $kso;
     $this->data['fleets'] = $optionFleet;
     $this->data['drivers'] = $optionDriver;
     return View::make('themes.modul.' . $this->views . '.formeditkso', $this->data);
 }
開發者ID:acmadi,項目名稱:diantaksi,代碼行數:40,代碼來源:ksos.php

示例2: get_exporttoxls

 /**
  * export to excel.
  *
  * @return
  */
 public function get_exporttoxls()
 {
     $drivers = Driver::order_by('nip', 'asc')->where('pool_id', '=', Auth::user()->pool_id)->get();
     return View::make('themes.modul.' . $this->views . '.export', compact('drivers'));
 }
開發者ID:acmadi,項目名稱:diantaksi,代碼行數:10,代碼來源:drivers.php


注:本文中的Driver::order_by方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。