fix duplicated packing list

This commit is contained in:
edmondlang
2023-03-08 14:32:10 +08:00
parent 535b8a59b9
commit 023954db70
+23 -1
View File
@@ -900,4 +900,26 @@ Route::get('/fix-invoices-drop-date/{orderMarking}', function($orderMarking){
dump($dilter);
$packingLists = (App()->make(ListsPackingLists::class))->execute($dilter);
dd($packingLists->first()->containers->first()->transports->first());
});
});Route::get('/packing-lists/show-duplicated', function(Request $request){
$results = PackingList::select('reference', 'type', DB::raw('count(*) as total'))
->groupBy('reference', 'type')
->having('total', '>', 1)
->get()->toArray();
echo '<table>';
echo "<tr>";
echo "<td style='border:1px solid'>reference</td>";
echo "<td style='border:1px solid'>type</td>";
echo "<td style='border:1px solid'>count</td>";
echo "</tr>";
foreach($results as $result) {
// dd($result);
echo "<tr>";
echo "<td style='border:1px solid'>" . $result['reference'] . "</td>";
echo "<td style='border:1px solid'>" . $result['type'] . "</td>";
echo "<td style='border:1px solid'>" . $result['total'] . "</td>";
echo "</tr>";
}
echo '</table>';
});