Add mobile number from mobile session to warranty raffle report. #719
This commit is contained in:
parent
8776d69a92
commit
5b6b090257
1 changed files with 23 additions and 1 deletions
|
|
@ -1269,6 +1269,7 @@ class ReportController extends Controller
|
|||
'First Name',
|
||||
'Last Name',
|
||||
'Contact Number',
|
||||
'Mobile Number', // number with mobile app
|
||||
'Address',
|
||||
'Email',
|
||||
'Action Taken',
|
||||
|
|
@ -2731,7 +2732,7 @@ class ReportController extends Controller
|
|||
wrl.date_create AS date_create, wrl.plate_number AS plate_number,
|
||||
wrl.first_name AS first_name, wrl.last_name AS last_name,
|
||||
wrl.contact_num AS contact_num, wrl.address AS address, wrl.email AS email,
|
||||
wrl.action AS action
|
||||
wrl.action AS action, wrl.api_user AS api_user_id
|
||||
FROM warranty_raffle_log wrl
|
||||
WHERE wrl.date_create >= :date_start
|
||||
AND wrl.date_create <= :date_end';
|
||||
|
|
@ -2770,6 +2771,26 @@ class ReportController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
// get the mobile number of the api user using api_user_id
|
||||
$api_user_id = $row['api_user_id'];
|
||||
$mobile_num = '';
|
||||
if ($api_user_id != null)
|
||||
{
|
||||
$api_sql = 'SELECT ms.phone_number AS mobile_number
|
||||
FROM mobile_session ms
|
||||
WHERE ms.id = :api_user_id';
|
||||
|
||||
$api_stmt = $db->prepare($api_sql);
|
||||
$api_stmt->bindValue('api_user_id', $api_user_id);
|
||||
|
||||
$api_result = $api_stmt->executeQuery();
|
||||
|
||||
while ($api_row = $api_result->fetchAssociative())
|
||||
{
|
||||
$mobile_num = $api_row['mobile_number'];
|
||||
}
|
||||
}
|
||||
|
||||
$raffle_number = '';
|
||||
$hub = '';
|
||||
$battery_name = $row['model_name'] . ' / ' . $row['size_name'];
|
||||
|
|
@ -2790,6 +2811,7 @@ class ReportController extends Controller
|
|||
'first_name' => $row['first_name'],
|
||||
'last_name' => $row['last_name'],
|
||||
'contact_number' => $row['contact_num'],
|
||||
'mobile_number' => $mobile_num,
|
||||
'address' => $row['address'],
|
||||
'email' => $row['email'],
|
||||
'action' => $row['action'],
|
||||
|
|
|
|||
Loading…
Reference in a new issue