FIX_OPEN_FOR_ENROLLMENT_REMINDER_MAIL

This commit is contained in:
VENKATESHWARAN 2026-04-27 15:09:10 +05:30
parent 8e578a0acd
commit c662db1794

View File

@ -438,11 +438,21 @@ public function getCliendDataForExcelFileName($client_policy_id){
public function getPolicyDetailsForRemainder($client_id = null, $branch_id = null, $policy_id = null)
{
$builder = $this->table('client_policy')
->join(
'(SELECT * FROM files
WHERE status = "success"
AND enrollment_open_date <= CURDATE()
AND enrollment_close_date >= CURDATE()
ORDER BY id DESC
LIMIT 1) as files',
'files.policy_id = client_policy.id'
)
->where('client_policy.is_active', 1)
->where('client_policy.policy_status', 1)
->where('client_policy.policy_status', 1);
// ->where('client_policy.is_addon', 1)
// ->where('client_policy.inception_type', 2)
->where('client_policy.open_for_enrollment', 1);
// ->where('client_policy.open_for_enrollment', 1);
if ($client_id && $branch_id) {
$builder->where('client_policy.client_id', $client_id)
@ -455,7 +465,11 @@ public function getPolicyDetailsForRemainder($client_id = null, $branch_id = nul
$builder->where('client_policy.id', $policy_id);
}
return $builder->get()->getResultArray();
$data = $builder->get()->getResultArray();
// print_r($this->db->getLastQuery()->getQuery()); die;
return $data;
}
//for this using in CRONE JOB