diff --git a/api/application/controllers/Flyhi_Controller.php b/api/application/controllers/Flyhi_Controller.php index 4aeb47c1..ca6c6cf4 100644 --- a/api/application/controllers/Flyhi_Controller.php +++ b/api/application/controllers/Flyhi_Controller.php @@ -252,7 +252,7 @@ class Flyhi_Controller extends REST_Controller { if($user_id && is_numeric($user_id)) { $where_condition_array['SALES_PD_DATA.createdby'] = $user_id; } - $where_condition_array['SALES_PD_DATA.sales_pd_type in (3,4)'] = null; + $where_condition_array['SALES_PD_DATA.sales_pd_type not in (1,2,3,4)'] = null; // comment this $order_by = 'SALES_PD_DATA.sales_pd_id'; $Flyhi_pd_data = $this->Flyhi_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC','',$or_where); @@ -281,8 +281,14 @@ class Flyhi_Controller extends REST_Controller { // $product = $records['product_id']; $flyhi_pd_type = isset($records['sales_pd_type']) ? $records['sales_pd_type'] : null; $product = isset($records['product_id']) ? $records['product_id'] : null; - $pd_type = 2; - if(isset($records['pd_type'])){ $pd_type = $records['pd_type'];} + $FHFSL_product = (ENVIRONMENT == 'production' ? 27 : 26); + $DFSL_lender = (ENVIRONMENT == 'production' ? 0 : 49); + $FHFSL_lender = (ENVIRONMENT == 'production' ? 19 : 31); + + if(isset($records['pd_type'])){ $pd_type = $records['pd_type']; } + if((int)$lender_id === $FHFSL_lender){ $pd_type = 2; } + if((int)$lender_id === $DFSL_lender){ $pd_type = 3; } + $template = $this->Flyhi_Model->selectCustomRecords(array('*'),array('lender_id' => $lender_id,'pd_type' => $pd_type,'sales_pd_type' => $flyhi_pd_type,'isactive' => 1),SALESPDTEMPLATE); // $template = $this->Flyhi_Model->selectCustomRecords(array('*'),array('lender_id' => $lender_id,'product_id' => $product,'pd_type' => $pd_type,'sales_pd_type' => $flyhi_pd_type,'isactive' => 1),SALESPDTEMPLATE); if(is_array($template) && count($template))