Commit 404625dd by Jansa Jose

add clicnic default

parent 29eff920
...@@ -2909,8 +2909,8 @@ class Webservice_model extends CI_Model { ...@@ -2909,8 +2909,8 @@ class Webservice_model extends CI_Model {
$this->db->join('tbl_clinic','tbl_clinic_doctors.clinic_id = tbl_clinic.id'); $this->db->join('tbl_clinic','tbl_clinic_doctors.clinic_id = tbl_clinic.id');
$this->db->where('tbl_clinic_doctors.doctor_id',$id); $this->db->where('tbl_clinic_doctors.doctor_id',$id);
$this->db->order_by('tbl_clinic.id','ASC'); $this->db->order_by('tbl_clinic.id','ASC');
$query = $this->db->get('tbl_clinic_doctors')->result(); $query = $this->db->get('tbl_clinic_doctors')->result_array();
print_r($query);exit(); //print_r($query);exit();
if(in_array(0, array_column($query, 'id')) || in_array('Default', array_column($query, 'name'))) { // if(in_array(0, array_column($query, 'id')) || in_array('Default', array_column($query, 'name'))) { //
array_splice($query, 0, 1); array_splice($query, 0, 1);
}else{ }else{
...@@ -2929,27 +2929,27 @@ class Webservice_model extends CI_Model { ...@@ -2929,27 +2929,27 @@ class Webservice_model extends CI_Model {
$this->db->join('tbl_doctors','tbl_clinic_doctors.doctor_id = tbl_doctors.id'); $this->db->join('tbl_doctors','tbl_clinic_doctors.doctor_id = tbl_doctors.id');
$this->db->where('tbl_clinic_doctors.clinic_id','0'); $this->db->where('tbl_clinic_doctors.clinic_id','0');
$this->db->where('tbl_clinic_doctors.doctor_id',$id); $this->db->where('tbl_clinic_doctors.doctor_id',$id);
$query_default = $this->db->get()->result(); $query_default = $this->db->get()->result_array();
foreach ($query_default as $key => $value) { foreach ($query_default as $key => $value) {
$query_default[$key]->street_address = decrypt_data($value->street_address); $query_default[$key]['street_address'] = decrypt_data($value['street_address']);
$query_default[$key]->locality = decrypt_data($value->locality); $query_default[$key]['locality'] = decrypt_data($value['locality']);
$query_default[$key]->number = decrypt_data($value->number); $query_default[$key]['number'] = decrypt_data($value['number']);
$query_default[$key]->complement = decrypt_data($value->complement); $query_default[$key]['complement'] = decrypt_data($value['complement']);
} }
$new_query = array_merge($query_default,$query); $new_query = array_merge($query_default,$query);
//echo"<pre>";print_r($new_query);exit(); //echo"<pre>";print_r($new_query);exit();
if(count($new_query) > 0){ if(count($new_query) > 0){
foreach ($new_query as $key => $value) { foreach ($new_query as $key => $value) {
$location = $value->street_address.','.$value->locality.','.$value->number.','.$value->complement; $location = $value['street_address'].','.$value['locality'].','.$value['number'].','.$value['complement'];
$new[$key]['id'] = $value->id; $new[$key]['id'] = $value['id'];
$new[$key]['name'] = $value->name; $new[$key]['name'] = $value['name'];
$new[$key]['email'] = $value->email; $new[$key]['email'] = $value['email'];
$new[$key]['photo'] = $value->profile_photo; $new[$key]['photo'] = $value['profile_photo'];
$new[$key]['location'] = $location; $new[$key]['location'] = $location;
$new[$key]['latitude'] = $value->location_lattitude; $new[$key]['latitude'] = $value['location_lattitude'];
$new[$key]['longitude'] = $value->location_longitude; $new[$key]['longitude'] = $value['location_longitude'];
} }
$return_array = array('status'=>'success','data'=>array('clinics'=>$new)); $return_array = array('status'=>'success','data'=>array('clinics'=>$new));
}else{ }else{
......
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