public function getDoctorListSearchCondition($search) { $arrcol = array(); $arrcol[] = "d.name"; $arrcol[] = "d.position"; $arrcol[] = "d.content"; $arrcol[] = "h.name"; $arrcol[] = "dp.name"; $arrcol[] = "c.name"; $arrcol[] = "s.name"; $arrcol[] = "cat.name"; $searchsql = splitCodition($arrcol, $search); return $searchsql; }
public function getDepartmentList($hospital_id, $search) { $hospital_id = parameter_filter($hospital_id); $arrcol = array(); $arrcol[] = "d.name"; $arrcol[] = "c.name"; $arrcol[] = "s.name"; $arrcol[] = "cat.name"; $arrcol[] = "dc.name"; $searchsql = splitCodition($arrcol, $search); $sql = "select distinct d.id, d.college_id,d.name from \ntb_hospital h\ninner join rc_hospital_college rc_hc on h.id=rc_hc.pid\ninner join tb_college c on rc_hc.fid=c.id and c.status='A'\ninner join tb_department d on c.id=d.college_id and d.status='A'\ninner join rc_department_subcategory rc_ds on d.id=rc_ds.pid \ninner join tb_subcategory s on rc_ds.fid=s.id\ninner join tb_category cat on s.category_id=cat.id\ninner join tb_doctor dc on h.id=dc.hospital_id and dc.status='A'\nwhere h.status='A' and h.id={$hospital_id}\nand {$searchsql}\norder by c.seq "; $query = $this->dbmgr->query($sql); $result = $this->dbmgr->fetch_array_all($query); return $result; }
public function getHospitalListPageCount($search) { $arrcol = array(); $arrcol[] = "h.name"; $arrcol[] = "h.shortname"; $arrcol[] = "h.content"; $arrcol[] = "d.name"; $arrcol[] = "dp.name"; $arrcol[] = "c.name"; $arrcol[] = "s.name"; $arrcol[] = "cat.name"; $searchsql = splitCodition($arrcol, $search); $sql = "select sum(1) hospital_count from (select distinct h.id\nfrom tb_hospital h \ninner join rc_hospital_college rc_hc on h.id=rc_hc.pid\ninner join tb_college c on rc_hc.fid=c.id and c.status='A'\ninner join tb_department dp on c.id=dp.college_id and dp.status='A'\ninner join rc_department_subcategory rc_ds on dp.id=rc_ds.pid\ninner join tb_subcategory s on rc_ds.fid=s.id\ninner join tb_category cat on cat.id=s.category_id\ninner join tb_doctor d on h.id=d.hospital_id and d.status='A'\n where d.status='A' \n and {$searchsql} ) a"; $query = $this->dbmgr->query($sql); $result = $this->dbmgr->fetch_array($query); return $result["hospital_count"]; }
public function getCaseListPageCount($member_id) { $searchsql = splitCodition($arrcol, $search); $sql = "select sum(1) count from (select a.* from tb_member_case a\n\t\tinner join tb_doctor d on a.doctor_id=d.id\n\t\twhere a.member_id={$member_id} and a.status<>'D' ) dc"; $query = $this->dbmgr->query($sql); $result = $this->dbmgr->fetch_array($query); return $result["count"]; }