public function driverDetails($param = array())
 {
     //$param = implode(',', $param);
     $data = Driver::select('id', 'onfleet_id', 'last_activity_timestamp', 'first_name', 'last_name')->whereIn('id', $param)->orderBy('last_activity_timestamp')->get();
     $driverDet = array();
     foreach ($data as $each) {
         $driverDet[] = array('id' => $each['id'], 'onfleet_id' => $each['onfleet_id'], 'last_activity_timestamp' => $each['last_activity_timestamp'], 'first_name' => $each['first_name'], 'last_name' => $each['last_name']);
     }
     return $driverDet;
 }
 protected function getMarketOfficeDriver()
 {
     $drivers = array();
     if (Session::get('admin_market_ofc') && Session::get('admin_market_ofc') != "") {
         $drivers = Driver::select("driver.id", DB::raw("CONCAT(driver.first_name, ' ', driver.last_name) AS name"), "driver.onfleet_worker_status")->join("driver_market_office", "driver_market_office.driver_id", "=", "driver.id")->where("driver.active", "true")->where("driver_market_office.market_office_id", Session::get('admin_market_ofc'))->get();
     }
     return $drivers;
 }
Beispiel #3
0
 public function getDriverInfo($driverId)
 {
     $driverInfo = Driver::select(DB::raw('*'))->where('id', $driverId)->first();
     if (!empty($driverInfo)) {
         if ($driverInfo['image'] != "" && $driverInfo['image'] != null) {
             $image = Config::get('images.driver') . $driverInfo['image'];
         } else {
             $image = "/images/avatar.png";
         }
         $driverInfo['image'] = $image;
         if (isset($driverInfo['onfleet_worker_status']) && $driverInfo['onfleet_worker_status'] == "true") {
             $driverInfo['order_status'] = "online";
             $driverInfo['red'] = false;
             $driverInfo['green'] = true;
         } else {
             $driverInfo['order_status'] = "offline";
             $driverInfo['red'] = true;
             $driverInfo['green'] = false;
         }
         if (isset($driverInfo['first_name']) && isset($driverInfo['last_name'])) {
             $driverInfo['name'] = $driverInfo['first_name'] . " " . $driverInfo['last_name'];
         }
     }
     return $driverInfo;
 }