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


PHP Driver::all方法代碼示例

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


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

示例1: list_ids

 protected function list_ids()
 {
     if ($this->_list_ids === NULL) {
         $this->_list_ids = (array) $this->_driver->all($this->_locator->xpath(), $this->_parent->id());
         if ($this->_locator->filters()) {
             foreach ($this->_list_ids as $offset => $id) {
                 if (!$this->_locator->is_filtered($this->_load($id), $offset)) {
                     unset($this->_list_ids[$offset]);
                 }
             }
         }
     }
     return $this->_list_ids;
 }
開發者ID:openbuildings,項目名稱:spiderling,代碼行數:14,代碼來源:Nodelist.php

示例2: getDrivers

 public function getDrivers()
 {
     $results = Driver::all()->toArray();
     foreach ($results as $key => $driver) {
         $driverName = $driver['first'] . ' ' . $driver['last'];
         $email = Users::where('id', '=', $driver['user_id'])->pluck('email');
         $hours = Driver::getHoursByDriverId($driver['user_id']);
         $trips = Driver::getTripsByDriverId($driver['user_id']);
         $earning = Driver::getEarningsByDriverId($driver['user_id']);
         $results[$key]['hours'] = $hours['hours'];
         $results[$key]['trips'] = $trips['count'];
         $results[$key]['earning'] = $earning['earning'];
         //.' '.$earning['currency'];
         $results[$key]['hour_per_trip'] = round($trips['count'] == 0 ? 0 : $hours['hours'] / $trips['count'], 2);
         $results[$key]['earning_per_hour'] = round($hours['hours'] == 0 ? 0 : $earning['earning'] / $hours['hours'], 2) . ' MAD';
         $results[$key]['earning_per_trip'] = round($trips['count'] == 0 ? 0 : $earning['earning'] / $trips['count'], 2) . ' MAD';
         $results[$key]['name'] = $driverName;
         $results[$key]['email'] = $email;
         unset($results[$key]['first']);
         unset($results[$key]['last']);
     }
     //Log::info(__METHOD__.print_r($results, 1));
     return json_encode($results);
 }
開發者ID:ardyaryan,項目名稱:presidential-car-api,代碼行數:24,代碼來源:AdminController.php


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