Commit dd12ffa1 by Jansa Jose

search doctors dates

parent 6a5b0aba
......@@ -1072,11 +1072,11 @@ class Webservice_model extends CI_Model {
$this->db->where($where);
}
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",false);
$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"];
//$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;
$this->db->where($new_where);
$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;
//$this->db->where($new_where);
//$this->db->or_where($or_where);
}
if(isset($data['others']) && strlen($data['others'])){
......
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