MIS Report filter dorpdown : ps

This commit is contained in:
VE10-Sanjeev 2023-06-01 09:57:38 +05:30
parent 21f0606260
commit 1d52e1e460

View File

@ -1361,7 +1361,13 @@ class SMC_Credit_PD_Controller extends REST_Controller {
$officer_name = $this->post('officer_name');
$from_date = $this->post('from_date');
$to_date = $this->post('to_date');
$date_type = $this->post('date_type');
if($date_type == 1) $filtered_column = 'createdon';
else if($date_type == 2) $filtered_column = 'updatedon';
else if($date_type == 3) $filtered_column = 'completed_on';
else $filtered_column = 'completed_on';
// $columns = array('PDTRIGGER.pd_id','PDTRIGGER.pd_sno','PDTYPE.type_name','PDTRIGGER.lender_applicant_id','PDTRIGGER.fk_product_id','PRODUCT.abbr','PDTRIGGER.pd_status','PDAPPLICANTSDETAILS.applicant_name','COMMONMASTER.createdon',('(SELECT createdon FROM h_common_masters where PDTRIGGER.pd_id = primary_key AND field_name = "pd_status" order by log_id DESC limit 1) as updatedon'),('(SELECT m_user_profile.first_name FROM h_common_masters JOIN m_user_profile on h_common_masters.new_value = m_user_profile.userid where PDTRIGGER.pd_id = primary_key AND field_name = "fk_pd_allocated_to" order by log_id DESC limit 1) as officer_name'));
// $table = PDTRIGGER.' as PDTRIGGER';
@ -1426,13 +1432,14 @@ class SMC_Credit_PD_Controller extends REST_Controller {
if($from_date)
{
// $this->db->WHERE('date(PDTRIGGER.updatedon) >=',$from_date);
$this->db->WHERE('date(PDTRIGGER.completed_on) >=',$from_date);
// $this->db->WHERE('date(PDTRIGGER.completed_on) >=',$from_date);
$this->db->WHERE('date(PDTRIGGER.'.$filtered_column.') >=',$from_date);
}
if($to_date)
{
// $this->db->WHERE('date(PDTRIGGER.updatedon) <=',$to_date);
$this->db->WHERE('date(PDTRIGGER.completed_on) <=',$to_date);
// $this->db->WHERE('date(PDTRIGGER.completed_on) <=',$to_date);
$this->db->WHERE('date(PDTRIGGER.'.$filtered_column.') <=',$to_date);
}
if($officer_name)
@ -1442,9 +1449,8 @@ class SMC_Credit_PD_Controller extends REST_Controller {
// AND date(PDTRIGGER.createdon) >= '2021-02-16'
// AND date(PDTRIGGER.createdon) <= '2021-02-19'
$this->db->ORDER_BY('PDTRIGGER.pd_id DESC');
$SMC_CREDIT_PD = $this->db->GET()->result_array();
// print_r($this->db->last_query());die();
//print_r($this->db->last_query());die();
if(count($SMC_CREDIT_PD))
{
$data['dataStatus'] = true;