CHANGE_ADD_DATE_FILTER
This commit is contained in:
parent
d9a5c84b74
commit
f4b172ca61
@ -719,6 +719,10 @@ class InvoiceController extends ResourceController
|
||||
try {
|
||||
|
||||
$manager_id = $this->request->getGet('manager_id');
|
||||
$from_date = $this->request->getGet('from_date');
|
||||
$to_date = $this->request->getGet('to_date');
|
||||
|
||||
|
||||
if ($manager_id === null || $manager_id === '') {
|
||||
return $this->respond([
|
||||
'status' => 'failed',
|
||||
@ -754,6 +758,11 @@ class InvoiceController extends ResourceController
|
||||
)
|
||||
->groupBy('pe.agent_id');
|
||||
|
||||
if(!empty($from_date) && !empty($to_date)){
|
||||
$query->where('partner_policy.issued_date >=', date('Y-m-d', strtotime((string) $from_date)));
|
||||
$query->where('partner_policy.issued_date <=', date('Y-m-d', strtotime((string) $to_date)));
|
||||
}
|
||||
|
||||
$data = $query->findAll();
|
||||
|
||||
// Grand total (optional but useful for FE)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user