Fix expired insured list

This commit is contained in:
Djery-Tom 2022-02-15 10:28:03 +01:00
parent 862c63604d
commit 3896576797
1 changed files with 10 additions and 2 deletions

View File

@ -39,8 +39,12 @@ class Insurances_model extends CI_Model
$this->db->from($this->table); $this->db->from($this->table);
$this->db->where('network_id', $postData['id_network']); $this->db->where('network_id', $postData['id_network']);
if (!empty($postData['state'])) { if (!empty($postData['state'])) {
if($postData['state'] == "STOPPED"){
$this->db->where_in('state', ["STOPPED","EXPIRED"]);
}else{
$this->db->where('state', $postData['state']); $this->db->where('state', $postData['state']);
} }
}
return $this->db->count_all_results(); return $this->db->count_all_results();
} }
@ -69,8 +73,12 @@ class Insurances_model extends CI_Model
$this->db->where('created_at <', date('Y-m-d', strtotime($postData['endDate']. "+1 day"))); $this->db->where('created_at <', date('Y-m-d', strtotime($postData['endDate']. "+1 day")));
} }
if (!empty($postData['state'])) { if (!empty($postData['state'])) {
if($postData['state'] == "STOPPED"){
$this->db->where_in('state', ["STOPPED","EXPIRED"]);
}else{
$this->db->where('state', $postData['state']); $this->db->where('state', $postData['state']);
} }
}
$i = 0; $i = 0;
// loop searchable columns // loop searchable columns