api user order
This commit is contained in:
@@ -6,11 +6,7 @@
|
|||||||
* Ordini attivi (non scaduti) di un utente, con ticket residui.
|
* Ordini attivi (non scaduti) di un utente, con ticket residui.
|
||||||
* Solo staff (Admin=1 / teacher=3). Replica get_user_orders.php.
|
* Solo staff (Admin=1 / teacher=3). Replica get_user_orders.php.
|
||||||
*
|
*
|
||||||
* Posizione: public/api/api_teacher_user_orders.php
|
* Metodo: GET | Auth: Bearer (Sanctum) via _bootstrap.php | Query: ?user_id=<int>
|
||||||
* Metodo: GET
|
|
||||||
* Auth: Bearer token (Sanctum) via _bootstrap.php
|
|
||||||
* Query: ?user_id=<int>
|
|
||||||
*
|
|
||||||
* Residui = ticket - (prenotazioni non cancellate e NON omaggio).
|
* Residui = ticket - (prenotazioni non cancellate e NON omaggio).
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@@ -78,4 +74,15 @@ try {
|
|||||||
'tickets' => $tickets,
|
'tickets' => $tickets,
|
||||||
'used' => $used,
|
'used' => $used,
|
||||||
'remaining' => $remaining,
|
'remaining' => $remaining,
|
||||||
'expireon' => $o['expireon'] ??
|
'expireon' => $o['expireon'] ?? null,
|
||||||
|
'maxreschedule' => (int) ($o['maxreschedule'] ?? 0),
|
||||||
|
'reprogrammed' => (int) ($o['reprogrammed'] ?? 0),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode(['success' => true, 'orders' => $orders], JSON_UNESCAPED_UNICODE);
|
||||||
|
} catch (Throwable $ex) {
|
||||||
|
error_log('api_teacher_user_orders error: ' . $ex->getMessage());
|
||||||
|
http_response_code(500);
|
||||||
|
echo json_encode(['success' => false, 'message' => 'Errore ordini: ' . $ex->getMessage(), 'orders' => []]);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user