Commit 25fade0b by Jansa Jose

Merge branch 'jansa'

parents e8d4c8de 175a0b57
...@@ -1429,8 +1429,8 @@ class Webservice_model extends CI_Model { ...@@ -1429,8 +1429,8 @@ class Webservice_model extends CI_Model {
$datalat = $data['location_latitude']; $datalat = $data['location_latitude'];
$datalong = $data['location_longitude']; $datalong = $data['location_longitude'];
$where = 'case when `tbl_clinic_doctors`.`clinic_id` != 0 then ROUND(( 6371 * acos( cos( radians({$datalat}) ) * cos( radians( `location_lattitude` ) ) * cos( radians( `location_longitude` ) - radians({$datalong}) ) + sin( radians({$datalat}) ) * sin( radians( `location_lattitude` ) ) ) )) else ROUND(( 6371 * acos( cos( radians({$datalat}) ) * cos( radians( `tbl_doctors`.`default_latitude` ) ) * cos( radians( `tbl_doctors`.`default_longitude` ) - radians({$datalong}) ) + sin( radians({$datalat}) ) * sin( radians( `tbl_doctors`.`default_latitude` ) ) ) )) end <='. 50; $where = 'when `tbl_clinic_doctors`.`clinic_id` != 0 then ROUND(( 6371 * acos( cos( radians({$datalat}) ) * cos( radians( `location_lattitude` ) ) * cos( radians( `location_longitude` ) - radians({$datalong}) ) + sin( radians({$datalat}) ) * sin( radians( `location_lattitude` ) ) ) )) else ROUND(( 6371 * acos( cos( radians({$datalat}) ) * cos( radians( `tbl_doctors`.`default_latitude` ) ) * cos( radians( `tbl_doctors`.`default_longitude` ) - radians({$datalong}) ) + sin( radians({$datalat}) ) * sin( radians( `tbl_doctors`.`default_latitude` ) ) ) )) end <='. 50;
$this->db->where($where); $this->db->where('case '.$where);
} }
if(isset($data['clinic_id']) && strlen($data['clinic_id'])){ if(isset($data['clinic_id']) && strlen($data['clinic_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