diff --git a/app/Filament/Widgets/RfqChart.php b/app/Filament/Widgets/RfqChart.php index ab14ce5..b2e2d79 100644 --- a/app/Filament/Widgets/RfqChart.php +++ b/app/Filament/Widgets/RfqChart.php @@ -98,7 +98,16 @@ class RfqChart extends BaseWidget $myAmount = (float) $selectedRfq->total_freight_charge; + // $rank = RfqTransporterBid::query() + // ->whereRaw( + // 'CAST(total_freight_charge AS DECIMAL(10,2)) < ?', + // [$myAmount] + // ) + // ->selectRaw('CAST(total_freight_charge AS DECIMAL(10,2))') + // ->distinct() + // ->count() + 1; $rank = RfqTransporterBid::query() + ->where('request_quotation_id', $rfqNumber) // 🔥 MISSING CONDITION ->whereRaw( 'CAST(total_freight_charge AS DECIMAL(10,2)) < ?', [$myAmount] @@ -107,6 +116,7 @@ class RfqChart extends BaseWidget ->distinct() ->count() + 1; + $medal = match (true) { $rank == 1 => '🥇', $rank == 2 => '🥈',