post method to get method : ps

This commit is contained in:
sanjeev 2021-12-28 11:52:25 +05:30
parent 91e98f5e92
commit 06b76d1c53
2 changed files with 18 additions and 2 deletions

View File

@ -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)

View File

@ -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);