mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
fix duplicate packages
This commit is contained in:
+3
-3
@@ -1172,9 +1172,9 @@ Route::get('/duplicate-package-clean-up', function(){
|
||||
}
|
||||
// Delete all rows in the group except the first one (oldest based on created_at)
|
||||
$firstRow = $rows->shift();
|
||||
// foreach ($rows as $row) {
|
||||
// Package::where('packages')->where('id', $row->id)->delete();
|
||||
// }
|
||||
foreach ($rows as $row) {
|
||||
Package::where('packages')->where('id', $row->id)->delete();
|
||||
}
|
||||
|
||||
// Calculate the case age for the group (assuming case age means difference between current date and created_at of the oldest row)
|
||||
$caseAge = Carbon::now()->diffInDays(Carbon::parse($firstRow->created_at));
|
||||
|
||||
Reference in New Issue
Block a user