diff --git a/api/application/config/constants.php b/api/application/config/constants.php index b9a41764..76c0d96b 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -592,5 +592,8 @@ defined('ENTITYFININSTITUTIONID') OR define('ENTITYFININSTITUTIONID','entity_fin defined('ENTITYPREFERENCS') OR define('ENTITYPREFERENCE','m_entity_preferences'); defined('ENTITYPREFERENCEID') OR define('ENTITYPREFERENCEID','entity_preference_id'); +defined('APP_VERSION_INFO') OR define('APP_VERSION_INFO','m_app_version_info'); +defined('APP_VERSION_INFOID') OR define('APP_VERSION_INFOID','version_info_id'); + diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 07f86d1e..34d8666b 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -82,6 +82,7 @@ $route['deletePdTeamMapping'] = 'Common_Masters_Controller/deletePdTeamMapping'; $route['getLender'] = 'Common_Masters_Controller/getLender'; $route['getProduct'] = 'Common_Masters_Controller/getProduct'; $route['getCustomerSegment'] = 'Common_Masters_Controller/getCustomerSegment'; +$route['(checkAppVersion/:any)'] = 'Common_Masters_Controller/checkAppVersion'; diff --git a/api/application/controllers/Common_Masters_Controller.php b/api/application/controllers/Common_Masters_Controller.php index e8363f85..dc782001 100644 --- a/api/application/controllers/Common_Masters_Controller.php +++ b/api/application/controllers/Common_Masters_Controller.php @@ -1168,4 +1168,25 @@ class Common_Masters_Controller extends REST_Controller { $this->response($data,REST_Controller::HTTP_OK); } } + + + public function checkAppVersion_get() + { + $client = $this->get('client'); + $version_data = $this->Common_Masters_Model-> getAppVersion($client); + + if($version_data) + { + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = $version_data; + $this->response($data,REST_Controller::HTTP_OK); + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NOT_MODIFIED; + $this->response($data,REST_Controller::HTTP_OK); + } + } } \ No newline at end of file diff --git a/api/application/models/Common_Masters_Model.php b/api/application/models/Common_Masters_Model.php index 3ac07cfa..efa6f74d 100644 --- a/api/application/models/Common_Masters_Model.php +++ b/api/application/models/Common_Masters_Model.php @@ -143,4 +143,21 @@ class Common_Masters_Model extends SPARQ_Model { } + function getAppVersion($client = null) + { + $this->db->SELECT('version_info_id, version, release_notes'); + $this->db->FROM(APP_VERSION_INFO); + $this->db->ORDER_BY(APP_VERSION_INFOID,'desc'); + if($client == 'MOB') + { + $this->db->LIMIT(1,0); + } + $data = $this->db->GET()->result_array(); + //print_r($this->db->last_query());die(); + + + return $data; + } + + } \ No newline at end of file