prepare( "SELECT a.order_id, a.offered_at, o.merchant_id, m.name_ar AS merchant_name_ar, m.latitude AS merchant_lat, m.longitude AS merchant_lng, o.delivery_fee, o.delivery_lat, o.delivery_lng FROM food_courier_assignments a JOIN food_orders o ON o.id = a.order_id JOIN food_merchants m ON m.id = o.merchant_id WHERE a.courier_id = ? AND a.status = 'offered' AND a.offered_at > (NOW() - INTERVAL 20 SECOND) ORDER BY a.offered_at ASC" ); $st->execute([$food_courier_id]); jsonSuccess(['offers' => $st->fetchAll()]);