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,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;