From 4c5073e39a7b23d916bbc6504cdd96c7c52f0a6c Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 24 Apr 2018 11:39:33 +0530 Subject: [PATCH 1/3] fees status changes --- Apollo/api/application/controllers/Fees_Status_Controller.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Apollo/api/application/controllers/Fees_Status_Controller.php b/Apollo/api/application/controllers/Fees_Status_Controller.php index fd3187bf..b09d7375 100755 --- a/Apollo/api/application/controllers/Fees_Status_Controller.php +++ b/Apollo/api/application/controllers/Fees_Status_Controller.php @@ -91,6 +91,7 @@ class Fees_Status_Controller extends REST_Controller { $student['requestedBy'] = $this->post('requestedtBy'); $student['CourseID'] = $this->post('courseID'); $student['StudentID'] = $this->post('studentID'); + $student['BranchCode'] = $this->post('branchCode'); $getStudentFeesDetails = $this->Fees_model->getStudentFeesStructure($student); if ($getStudentFeesDetails) { From e8117e1d6b5f3959403ce155015b0c09163dbd1f Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 24 Apr 2018 12:18:27 +0530 Subject: [PATCH 2/3] fees status changes done --- .../api/application/models/Fees_status_model.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index 81d3cad3..8e514810 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -261,6 +261,7 @@ class Fees_status_model extends CI_Model $this->db->where('STC.StudentID', $student['StudentID']); $this->db->where('SFP.StudentID', $student['StudentID']); $this->db->where('SFP.IsActive','1'); + $this->db->where('US.BranchCode',$student['BranchCode']); $this->db->order_by('SFP.ID', 'DESC'); $getFeeDetails = $this->db->get(); if($getFeeDetails->result()){ @@ -372,6 +373,7 @@ class Fees_status_model extends CI_Model $this->db->where('SFS.StudentID', $student['StudentID']); $this->db->where('STC.StudentID', $student['StudentID']); $this->db->where('SFP.StudentID', $student['StudentID']); + $this->db->where('US.BranchCode',$student['BranchCode']); $this->db->where('SFP.IsActive','1'); $this->db->where_in('SFS.FeesType', $serachArray); $this->db->order_by('SFP.ID', 'DESC'); @@ -1379,6 +1381,9 @@ class Fees_status_model extends CI_Model * created by kms * */ public function updateFeesStatusInCallTrack($studentID=null,$courseID=null){ + // get student details + $studentDetails = $this->studentInfoForFeesStatus($studentID,$courseID); + $now = new DateTime(); $now->setTimezone(new DateTimezone('Asia/Kolkata')); $currentDate = new DateTime(date("d-m-Y")); @@ -1389,12 +1394,11 @@ class Fees_status_model extends CI_Model $this->db->from(PICK_LIST_DETAILS.' as PLD'); $this->db->where('PLD.ListName','PENDING'); $this->db->where('PLD.IsActive','1'); + $this->db->where('PLD.BranchCode',$studentDetails->BranchID); $checkStatus=$this->db->get()->last_row(); if($checkStatus){ - $studentDetails = $this->studentInfoForFeesStatus($studentID,$courseID); - if($studentDetails){ $arrayDetails['MobileNumber']=$studentDetails->MobileNumber; $arrayDetails['LeadName']=$studentDetails->Firstname; @@ -1426,6 +1430,7 @@ class Fees_status_model extends CI_Model $this->db->select('ActivityID,ActivityName'); $this->db->like('ActivityName', 'Fees', 'after'); $this->db->where('IsActive', '1'); + $this->db->where('BranchCode', $studentDetails->BranchID); $activityDetails=$this->db->get(ACTIVITY)->last_row(); if($activityDetails){ @@ -1581,7 +1586,11 @@ class Fees_status_model extends CI_Model * created by kms * */ public function studentInfoForFeesStatus($studentID=null,$courseID=null){ - + // this sub query for avoid university duplicate id + $this->db->select('BranchID')->from(STUDENTCOURSE); + $this->db->where('StudentID',$studentID); + $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'); @@ -1589,6 +1598,7 @@ class Fees_status_model extends CI_Model $this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID'); $this->db->where('ST.StudentID',$studentID); $this->db->where('STC.CourseID',$courseID); + $this->db->where('US.BranchCode IN('. $subQuery.')', NULL, FALSE); $leadDet=$this->db->get()->last_row(); if($leadDet){ return $leadDet; From 7373cb977f414bbdfd5e2d138900bf3b64e42fa3 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 24 Apr 2018 13:02:08 +0530 Subject: [PATCH 3/3] student fees status changes --- Apollo/api/application/controllers/Fees_Status_Controller.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Apollo/api/application/controllers/Fees_Status_Controller.php b/Apollo/api/application/controllers/Fees_Status_Controller.php index b09d7375..b1e5e6e4 100755 --- a/Apollo/api/application/controllers/Fees_Status_Controller.php +++ b/Apollo/api/application/controllers/Fees_Status_Controller.php @@ -245,6 +245,7 @@ class Fees_Status_Controller extends REST_Controller { $details['CreatedBy'] = $this->post('createdBy'); $details['CreatedOn'] = $now->format('Y-m-d H:i:s'); $details['BatchCode'] = $this->post('batchCode'); + $details['BranchCode'] = $this->post('branchCode'); $jsonInstallmenData = $this->post('installmentItems');