Commit 1502c333 by Jansa Jose

search doctors date issue

parent dd12ffa1
...@@ -1071,14 +1071,14 @@ class Webservice_model extends CI_Model { ...@@ -1071,14 +1071,14 @@ class Webservice_model extends CI_Model {
$where = 'tbl_doctors.specialization ='. "'$speciality'"; $where = 'tbl_doctors.specialization ='. "'$speciality'";
$this->db->where($where); $this->db->where($where);
} }
if(isset($data['date']) && strlen($data['date'])){ // if(isset($data['date']) && strlen($data['date'])){
$this->db->join("tbl_doctor_leave","tbl_doctors.id = tbl_doctor_leave.doctor_id and tbl_clinic_doctors.clinic_id = tbl_doctor_leave.clinic_id","LEFT"); // $this->db->join("tbl_doctor_leave","tbl_doctors.id = tbl_doctor_leave.doctor_id and tbl_clinic_doctors.clinic_id = tbl_doctor_leave.clinic_id","LEFT");
$date = $data["date"]; // $date = $data["date"];
$this->db->where("(tbl_doctor_leave.start_date IS NULL or ($date<tbl_doctor_leave.start_date OR $date>tbl_doctor_leave.end_date))"); // $this->db->where("(tbl_doctor_leave.start_date IS NULL or ($date<tbl_doctor_leave.start_date OR $date>tbl_doctor_leave.end_date))");
//$new_where = "(select count(*) from tbl_doctor_leave where ($date > tbl_doctor_leave.start_date OR $date < tbl_doctor_leave.end_date)) =". 0; // //$new_where = "(select count(*) from tbl_doctor_leave where ($date > tbl_doctor_leave.start_date OR $date < tbl_doctor_leave.end_date)) =". 0;
//$this->db->where($new_where); // //$this->db->where($new_where);
//$this->db->or_where($or_where); // //$this->db->or_where($or_where);
} // }
if(isset($data['others']) && strlen($data['others'])){ if(isset($data['others']) && strlen($data['others'])){
if($data['others'] == 'MEN' || $data['others'] == 'WOMEN'){ if($data['others'] == 'MEN' || $data['others'] == 'WOMEN'){
if($data['others'] == 'MEN'){ if($data['others'] == 'MEN'){
...@@ -1129,6 +1129,13 @@ class Webservice_model extends CI_Model { ...@@ -1129,6 +1129,13 @@ class Webservice_model extends CI_Model {
//echo $this->db->last_query();exit(); //echo $this->db->last_query();exit();
//print_r($this->db->last_query());die(); //print_r($this->db->last_query());die();
if ($query->num_rows() > 0) { if ($query->num_rows() > 0) {
if(isset($data['date']) && strlen($data['date'])){
$date = $data['date'];
$where = '$date<tbl_doctor_leave.start_date OR $date>tbl_doctor_leave.end_date';
$this->db->where($where);
$leave_query = $this->db->get('tbl_doctor_leave')->result();
print_r($leave_query);exit();
}
$return_array = array('status'=>'success','data'=>$query->result_array()); $return_array = array('status'=>'success','data'=>$query->result_array());
} }
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