Add customer name, customer mobile number. #594

This commit is contained in:
Korina Cordero 2021-07-01 04:33:04 +00:00
parent 0a706f453b
commit b39872e4e0

View file

@ -1152,8 +1152,14 @@ class ReportController extends Controller
fputcsv($csv_handle, [
'Filtered Hub ID',
'Hub Name',
'Job Order ID',
'Customer ID',
'Customer Last Name',
'Customer First Name',
'Customer Mobile Number',
'Date Created',
'Reason',
'Date of Rejection',
]);
foreach ($data as $row)
@ -2325,7 +2331,7 @@ class ReportController extends Controller
$db = $em->getConnection();
// get hub filter logs
$sql = 'SELECT hf.hub_filtered_id, h.name, hf.date_create, hf.filter_type_id FROM hub_filter_log hf, hub h WHERE hf.hub_filtered_id=h.id AND hf.date_create >= :date_start AND hf.date_create <= :date_end';
$sql = 'SELECT hf.hub_filtered_id, h.name, hf.jo_id, hf.customer_id, c.last_name, c.first_name, c.phone_mobile, hf.date_create, hf.filter_type_id FROM hub_filter_log hf, hub h, customer c WHERE hf.hub_filtered_id=h.id AND c.id=hf.customer_id AND hf.date_create >= :date_start AND hf.date_create <= :date_end ORDER BY hf.date_create';
$stmt = $db->prepare($sql);
$stmt->execute([
'date_start' => $new_date_start,
@ -2339,8 +2345,14 @@ class ReportController extends Controller
$result[] = [
$row[0], // filtered hub id
$row[1], // hub name
$row[2], // date create
$row[3], // reason
$row[2], // job order id
$row[3], // customer id
$row[4], // customer last name
$row[5], // customer first name
$row[6], // customer mobile
$row[7], // date create
$row[8], // filter type id
$row[7], // date of rejection
];
}