diff --git a/api/application/controllers/Template_Management_Controller.php b/api/application/controllers/Template_Management_Controller.php index 627b43a8..2a25df91 100644 --- a/api/application/controllers/Template_Management_Controller.php +++ b/api/application/controllers/Template_Management_Controller.php @@ -922,8 +922,20 @@ class Template_Management_Controller extends REST_Controller { } // API 2 Get Template with Form Details V2.0 : ps 20/12/2021 - public function getTemplateFormsV2_post(){ - $records = $this->post("records"); + public function getTemplateFormsV2_get(){ + if(isset($_GET['map_id'])) +{ + $records['map_id'] = $this->get("map_id");} + if(isset($_GET['entity_id'])) +{ + $records['entity_id'] = $this->get("entity_id");} + if(isset($_GET['product_id'])) +{ + $records['product_id'] = $this->get("product_id");} + if(isset($_GET['customer_segment_id'])) +{ + $records['customer_segment_id'] = $this->get("customer_segment_id");} + $result_array = $this->Template_Management_Model->getTemplateMappingDetailsV2($records); if(!empty($result_array)) foreach($result_array as $inx => $arr) diff --git a/api/application/models/Template_Management_Model.php b/api/application/models/Template_Management_Model.php index a552c263..00dd36b1 100644 --- a/api/application/models/Template_Management_Model.php +++ b/api/application/models/Template_Management_Model.php @@ -300,6 +300,10 @@ class Template_Management_Model extends SPARQ_Model { { $this->db->WHERE('TEMPLATE_MAP_V2.customer_segment_id',$value['customer_segment_id']); } + if(isset($value['map_id'])) + { + $this->db->WHERE('TEMPLATE_MAP_V2.id',$value['map_id']); + } } else { $this->db->WHERE('TEMPLATE_MAP_V2.entity_id',$value);