update status manual jika ada cancel / waiting billing
This commit is contained in:
@@ -57,18 +57,18 @@ class AutoUpdateLogStatus extends Command
|
||||
$cancelLogs = RequestLog::where('final_log', 0)
|
||||
->whereNull('deleted_at')
|
||||
->where('submission_date', '<', $sixMonthsAgo)
|
||||
->where('status', '!=', 'cancel')
|
||||
->where('status', '!=', 'canceled')
|
||||
->get();
|
||||
|
||||
foreach ($cancelLogs as $log) {
|
||||
RequestLogHistory::create([
|
||||
'request_log_id' => $log->id,
|
||||
'old_status' => $log->status,
|
||||
'new_status' => 'cancel',
|
||||
'new_status' => 'canceled',
|
||||
'notes' => 'Auto update status via cronjob',
|
||||
'changed_at' => now(),
|
||||
]);
|
||||
$log->update(['status' => 'cancel']);
|
||||
$log->update(['status' => 'canceled']);
|
||||
}
|
||||
|
||||
$this->info("Auto update selesai. Billing: " . count($billingLogs) . ", Cancel: " . count($cancelLogs));
|
||||
|
||||
Reference in New Issue
Block a user