Add checking for nulls when creating the data for backup. #762

This commit is contained in:
Korina Cordero 2023-09-07 18:01:13 +08:00
parent 22d4201097
commit c318c471ff

View file

@ -311,34 +311,83 @@ class GetJobOrderArchiveDataCommand extends Command
$fac_type = $row['facilitated_type']; $fac_type = $row['facilitated_type'];
$coord_long = $row['coord_long']; $coord_long = $row['coord_long'];
$coord_lat = $row['coord_lat'];
$priority = $row['priority']; $priority = $row['priority'];
$meta = $row['meta']; $meta = $row['meta'];
$status_autoassign = $row['status_autoassign'];
$status_autoassign = '\N';
if ($row['status_autoassign'] != NULL)
$status_autoassign = $row['status_autoassign'];
$first_name = $row['first_name']; $first_name = $row['first_name'];
$last_name = $row['last_name']; $last_name = $row['last_name'];
$plate_number = $row['plate_number']; $plate_number = $row['plate_number'];
$phone_mobile = $row['phone_mobile']; $phone_mobile = $row['phone_mobile'];
$no_trade_in_reason = $row[' no_trade_in_reason'];
$no_trade_in_reason = '\N';
if ($row['no_trade_in_reason'] != NULL)
$no_trade_in_reason = $row[' no_trade_in_reason'];
$will_wait = $row['will_wait']; $will_wait = $row['will_wait'];
$reason_not_waiting = $row['reason_not_waiting'];
$not_waiting_notes = $row['not_waiting_notes']; $reason_not_waiting = '\N';
$del_status = $row['delivery_status']; if ($row['reason_not_waiting'] != NULL)
$emergency_type_id = $row['emergency_type_id']; $reason_not_waiting = $row['reason_not_waiting'];
$owner_type_id = $row['ownership_type_id'];
$cust_location_id = $row['cust_location_id']; $not_waiting_notes = '\N';
$source_of_awareness = $row['source_of_awareness']; if ($row['not_waiting_notes'] != NULL)
$remarks = $row['remarks']; $not_waiting_notes = $row['not_waiting_notes'];
$initial_concern = $row['initial_concern'];
$initial_concern_notes = $row['initial_concern_notes']; $del_status = '\N';
$gender = $row['gender']; if ($row['delivery_status'] != NULL)
$caller_class = $row['caller_classification']; $del_status = $row['delivery_status'];
$emergency_type_id = '\N';
if ($row['emergency_type_id'] != NULL)
$emergency_type_id = $row['emergency_type_id'];
$owner_type_id = '\N';
if ($row['ownership_type_id'] != NULL)
$owner_type_id = $row['ownership_type_id'];
$cust_location_id = '\N';
if ($row['cust_location_id'] != NULL)
$cust_location_id = $row['cust_location_id'];
$source_of_awareness = '\N';
if ($row['source_of_awareness'] != NULL)
$source_of_awareness = $row['source_of_awareness'];
$remarks = '\N';
if ($row['remarks'] != NULL)
$remarks = $row['remarks'];
$initial_concern = '\N';
if ($row['initial_concern'] != NULL)
$initial_concern = $row['initial_concern'];
$initial_concern_notes = '\N';
if ($row['initial_concern_notes'] != NULL)
$initial_concern_notes = $row['initial_concern_notes'];
$gender = '\N';
if ($row['gender'] != NULL)
$gender = $row['gender'];
$caller_class = '\N';
if ($row['caller_classification'] != NULL)
$caller_class = $row['caller_classification'];
$inv_count = $row['inventory_count']; $inv_count = $row['inventory_count'];
// check for nulls. check the ff fields since these can be null: date_fulfill, date_cancel, date_assign, create_user_id, // create the array for the file
// assign_user_id, proces_user_id, hub_id, rider_id, cancel_reason, ref_jo_id, or_num, trade_in_type, $data = [
// flag_rider_rating, facilitated_type, facilitated_hub_id, status_autoassign, reason_not_waiting, $id,
// not_waiting_notes, no_trade_in_reason, delivery_status, source_of_awareness, remarks, initial_concern, $cust_id,
// initial_concern_notes, gender, caller_classifications, emergency_type_id, ownership_type_id, cust_location_id // TODO: finish writing to array
];
return $data;
} }
// TODO: write the load data file function
} }