Commit 609ee00e by Jansa Jose

Merge branch 'master' into 'dev_production'

Master See merge request !28
parents bfa15e7c 78054278
...@@ -2783,7 +2783,7 @@ public function end_ride_update_post(){ ...@@ -2783,7 +2783,7 @@ public function end_ride_update_post(){
} }
} }
}else{ }else{
$res = array('status'=>'error','error'=>'error','message'=>'3 Something Went Wrong.. Try Again Later'); $res = array('status'=>'success');
} }
}elseif($request['recur_type'] == '1'){ }elseif($request['recur_type'] == '1'){
//$ride_strt = explode('T',$request['start_date']); //$ride_strt = explode('T',$request['start_date']);
......
...@@ -955,11 +955,12 @@ function offer_update($request){ ...@@ -955,11 +955,12 @@ function offer_update($request){
public function get_find_ride($request){ public function get_find_ride($request){
$this->db->where('no_of_seats >=',$request['seats']); $this->db->where('no_of_seats >=',$request['seats']);
$this->db->where('ride.status!=',2); $this->db->where('ride.status!=',2);
$this->db->where('ride.ride_status!=',3); $this->db->where('(ride.ride_status!= 3 or ride.ride_status!= 4 or ride.ride_status!= 5)');
$this->db->or_where('ride.ride_status!=',4); // $this->db->or_where('ride.ride_status!=',4);
$this->db->or_where('ride.ride_status!=',5); //$this->db->or_where('ride.ride_status!=',5);
$this->db->order_by('ride.id','DESC');
if($request['user_id']!='undefined'){ if($request['user_id']!='undefined'){
$this->db->where('users_id!=',$request['user_id']); $this->db->where('ride.users_id!=',$request['user_id']);
} }
if(isset($request['for_ladies']) && !empty($request['for_ladies'])){ if(isset($request['for_ladies']) && !empty($request['for_ladies'])){
$this->db->where('for_ladies',$request['for_ladies']); $this->db->where('for_ladies',$request['for_ladies']);
...@@ -979,7 +980,7 @@ function offer_update($request){ ...@@ -979,7 +980,7 @@ function offer_update($request){
// $this->db->join('rating','ride.id=rating.rate_id','left'); // $this->db->join('rating','ride.id=rating.rate_id','left');
$query= $this->db->get(); $query= $this->db->get();
// echo $this->db->last_query(); //echo $this->db->last_query();
return $query->result(); return $query->result();
...@@ -2376,13 +2377,19 @@ public function update_currency($data){ ...@@ -2376,13 +2377,19 @@ public function update_currency($data){
} }
public function get_ride_members($data){ public function get_ride_members($data){
$this->db->select("TRIM(concat(users.first_name,' ',IFNULL(users.last_name,''))) as name,IF(users.profile_photo != NULL OR users.profile_photo != '' , concat('".base_url()."',users.profile_photo) , '') profile_pic,users.id as rider_id,booking.status"); $this->db->select("DISTINCT(TRIM(concat(users.first_name,' ',IFNULL(users.last_name,'')))) as name,IF(users.profile_photo != NULL OR users.profile_photo != '' , concat('".base_url()."',users.profile_photo) , '') profile_pic,users.id as rider_id,booking.status");
$this->db->join('users','users.id = booking.user_id'); $this->db->join('users','users.id = booking.user_id');
$this->db->where('booking.ride_id',$data['ride_id']); $this->db->where('booking.ride_id',$data['ride_id']);
$this->db->where('booking.user_id !=',$data['user_id']); $this->db->where('booking.user_id !=',$data['user_id']);
$this->db->group_by('booking.user_id');
$result = $this->db->get('booking')->result(); $result = $this->db->get('booking')->result();
//echo $this->db->last_query();exit;
if($result){ if($result){
foreach ($result as $key => $value) {
$this->db->select('sum(no_of_seats) as no_seats');
$ride_data = $this->db->get_where('booking',array('user_id'=>$value->rider_id,'ride_id'=>$data['ride_id']))->row();
$result[$key]->no_of_seats = $ride_data->no_seats;
}
$res = array('status'=>'success','data'=>$result); $res = array('status'=>'success','data'=>$result);
}else{ }else{
$res = array('status'=>'error'); $res = array('status'=>'error');
......
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