From 389657679781c5c2349723188e91d7eb58ef9b91 Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Tue, 15 Feb 2022 10:28:03 +0100 Subject: [PATCH] Fix expired insured list --- application/models/pagination/Insurances_model.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/application/models/pagination/Insurances_model.php b/application/models/pagination/Insurances_model.php index 86b9cc94..0aa5d490 100644 --- a/application/models/pagination/Insurances_model.php +++ b/application/models/pagination/Insurances_model.php @@ -39,7 +39,11 @@ class Insurances_model extends CI_Model $this->db->from($this->table); $this->db->where('network_id', $postData['id_network']); if (!empty($postData['state'])) { - $this->db->where('state', $postData['state']); + if($postData['state'] == "STOPPED"){ + $this->db->where_in('state', ["STOPPED","EXPIRED"]); + }else{ + $this->db->where('state', $postData['state']); + } } return $this->db->count_all_results(); } @@ -69,7 +73,11 @@ class Insurances_model extends CI_Model $this->db->where('created_at <', date('Y-m-d', strtotime($postData['endDate']. "+1 day"))); } if (!empty($postData['state'])) { - $this->db->where('state', $postData['state']); + if($postData['state'] == "STOPPED"){ + $this->db->where_in('state', ["STOPPED","EXPIRED"]); + }else{ + $this->db->where('state', $postData['state']); + } } $i = 0;