İ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
+31
View File
@@ -0,0 +1,31 @@
<?php
function getLowestSpoolStatus($spoolStatuses) {
// Eğer tüm spool_status değerleri "Completed" ise
if (count(array_filter($spoolStatuses, fn($status) => $status !== 'Completed')) === 0) {
return 'Completed';
}
// Spool durumlarını sayısal değerlere göre sıralayıp en düşük olanı döndür
$statusValues = [
'Waiting',
'On Going',
'Spool Release',
'NDT Release',
'Paint',
'Completed'
];
// Geçerli spool durumlarını kontrol et ve en düşük durumu bul
$lowestStatus = null; // Başlangıçta en düşük durum yok
foreach ($statusValues as $status) {
if (in_array($status, $spoolStatuses)) {
if ($lowestStatus === null || array_search($status, $statusValues) < array_search($lowestStatus, $statusValues)) {
$lowestStatus = $status;
}
}
}
return $lowestStatus;
}
?>