本文整理匯總了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);
}
示例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'));
}