İlk temizlik tamamlandı bir önceki projeden

This commit is contained in:
Ümit Tunç
2026-04-28 21:14:25 +03:00
commit f80443aec0
10000 changed files with 959965 additions and 0 deletions
@@ -0,0 +1,28 @@
<?php
$id = $request['key'];
// Get the paint matrix record before deletion
$paintMatrix = db('paint_matrices')->where('id', $id)->first();
if ($paintMatrix) {
// Delete from paint_follow_ups
db('paint_follow_ups')
->where([
'line' => $paintMatrix->line,
'area' => $paintMatrix->area,
])
->whereNull('primer_coating_start_date') // Only delete if primer coating start date is null
->delete();
// Delete from construction_paint_logs
db('construction_paint_logs')
->where([
'line' => $paintMatrix->line,
'unit' => $paintMatrix->area,
])
->whereNull('painting_date_1') // Only delete if primer coating start date is null
->delete();
dump("Deleted related records for paint matrix ID: $id");
}
?>