diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index 3f3723f6..c9671e7c 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -1588,18 +1588,18 @@ class Fees_status_model extends CI_Model * */ public function studentInfoForFeesStatus($studentID=null,$courseID=null){ // this sub query for avoid university duplicate id - $this->db->select('BranchID')->from(STUDENTCOURSE); + /* $this->db->select('BranchID')->from(STUDENTCOURSE); $this->db->where('StudentID',$studentID); - $subQuery = $this->db->get_compiled_select(); + $subQuery = $this->db->get_compiled_select();*/ // subquery end $this->db->select('ST.Firstname,ST.MobileNumber,US.UniversityName,CU.CourseName,STC.BranchID'); $this->db->from(STUDENTCOURSE.' as STC'); $this->db->join(STUDENTS.' as ST', 'ST.StudentID = STC.StudentID'); $this->db->join(COURSE.' as CU', 'CU.CourseID = STC.CourseID'); - $this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID'); + $this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID AND STC.BranchID=US.BranchCode'); $this->db->where('ST.StudentID',$studentID); $this->db->where('STC.CourseID',$courseID); - $this->db->where('US.BranchCode IN('. $subQuery.')', NULL, FALSE); + // $this->db->where('US.BranchCode IN('. $subQuery.')', NULL, FALSE); $leadDet=$this->db->get()->last_row(); if($leadDet){ return $leadDet;