16 lines
779 B
PHP
16 lines
779 B
PHP
<?php
|
|
// food/order/status.php — حالة الطلب الحالية (مصدر الحقيقة عند إعادة الاتصال بالسوكيت)
|
|
require_once __DIR__ . '/../connect_app.php';
|
|
|
|
$orderId = filterRequest('order_id', 'int');
|
|
if (!$orderId) jsonError('order_id is required');
|
|
|
|
$order = foodAssertOrderOwnership($orderId, 'customer', $food_passenger_id);
|
|
|
|
$itemsSt = $food_con->prepare("SELECT name_ar_snapshot, unit_price, quantity, line_total FROM food_order_items WHERE order_id=?");
|
|
$itemsSt->execute([$orderId]);
|
|
$order['items'] = $itemsSt->fetchAll();
|
|
|
|
// عناوين/أرقام الزبون تُحجب عن السائق قبل courier_assigned وبعد delivered — هنا هي بوابة الزبون نفسه فلا حجب
|
|
jsonSuccess(['order' => $order]);
|