Commit 642dc644 by Tobin

Merge branch 'master' into 'production'

dc See merge request !25
parents 22627e3d 0927cbc6
......@@ -175,7 +175,7 @@ class Ride_model extends CI_Model {
$driverCond = '';
if(!empty($prvDrivers) && $prvDrivers->num_rows() > 0 &&
!empty($prvDrivers = $prvDrivers->row_array()) && isset($prvDrivers['assigned_drivers']) &&
!empty($prvDrivers=$prvDrivers->row_array()) && isset($prvDrivers['assigned_drivers']) &&
!empty($prvDrivers['assigned_drivers'])){
$prvDrivers = explode(',',$prvDrivers['assigned_drivers']);
$drivers = array_diff($drivers,$prvDrivers);
......@@ -183,9 +183,9 @@ class Ride_model extends CI_Model {
if(!empty($drivers)){
$drv_ids = implode(",",$drivers);
$sql = "SELECT DRV.driver_id,DRV.fcm_token,
3956*2*ASIN(SQRT(POWER(SIN(($locData['plat']-DRV.active_loc_lat)*
pi()/180/2),2)+COS($locData['plat']*pi()/180)*COS(DRV.active_loc_lat*
pi()/180)*POWER(SIN(($locData['plng']-DRV.active_loc_lng)*
3956*2*ASIN(SQRT(POWER(SIN((".$locData['plat']."-DRV.active_loc_lat)*
pi()/180/2),2)+COS(".$locData['plat']."*pi()/180)*COS(DRV.active_loc_lat*
pi()/180)*POWER(SIN((".$locData['plng']."-DRV.active_loc_lng)*
pi()/180/2),2))) AS distance
FROM drivers AS DRV
WHERE DRV.status = 1 AND DRV.driver_id IN ($drv_ids) AND
......
......@@ -2442,7 +2442,8 @@ function booster_seat($request) {
$drvAuth = $this->db->where('unique_id', $data['auth'])->get('driver_auth_table');
if(!empty($drvAuth) && $drvAuth->num_rows()>0 &&
$drvData=$drvAuth->row() && !empty($driver_id=$drvData->driver_id)){
!empty($drvData=$drvAuth->row()) && isset($drvData->driver_id) &&
!empty($driver_id=$drvData->driver_id)){
$status = $this->db->update('transport_details',array('status'=>4),
array('transport_id'=>$data['trip_id']));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment