'Warning',E_NOTICE=>'Notice',E_USER_ERROR=>'UserError',E_USER_WARNING=>'UserWarning',E_USER_NOTICE=>'UserNotice',E_STRICT=>'Strict',E_DEPRECATED=>'Deprecated',E_RECOVERABLE_ERROR=>'Recoverable']; $type = isset($types[$errno]) ? $types[$errno] : "Error[$errno]"; if (file_exists(__DIR__ . '/core.php')) { // core.php may not be loaded yet, define minimal debugLog if (!function_exists('debugLog')) { function debugLog($msg) { $lf = __DIR__ . '/db/debug.log'; @file_put_contents($lf, "[" . date('Y-m-d H:i:s') . "] [orders.php] $msg\n", FILE_APPEND | LOCK_EX); // ★ 保留策略(2026-10-05):只留最近3天 + ≤5MB,任一超标即清理到两条件同时满足 if (is_file(__DIR__ . '/log_maintain.php')) { @require_once __DIR__ . '/log_maintain.php'; if (function_exists('logMaintain')) { @logMaintain($lf); } } } } debugLog("[orders.php] PHP {$type}: {$errstr} in {$errfile}:{$errline}"); } return true; // 不阻止默认错误处理 }); require_once __DIR__ . '/core.php'; // ★ 强制使 opcache 失效,确保部署后的新版(含请求超时/重试)立即生效, // 避免 Web 服务端 opcache 持续服务旧版 orders.php(无超时→永久"加载中") if (function_exists('opcache_invalidate')) { @opcache_invalidate(__FILE__); } if (session_status() === PHP_SESSION_NONE) session_start(); // ★ 输出缓冲:捕获任何前置输出(PHP warning/notice/BOM等),防止破坏前端JSON解析 $preOutput = ''; if (ob_get_level() > 0) { $preOutput = ob_get_clean(); } if (!empty($preOutput)) { // 记录但不阻断:有前置输出说明某处产生了warning/notice/BOM debugLog('[orders.php] 检测到前置输出(' . strlen($preOutput) . ' bytes): ' . substr(trim($preOutput), 0, 500)); } try { $loggedIn = isAdminLoggedIn() || isCashierLoggedIn(); $role = 'guest'; $name = ''; if (isAdminLoggedIn()) { $role = 'admin'; $name = 'admin'; } elseif (isCashierLoggedIn()) { $c = getCurrentCashier() ?: []; $role = 'cashier'; $name = $c['username'] ?? ''; } } catch (\Throwable $e) { debugLog('[orders.php] 会话状态判定异常: ' . $e->getMessage()); $loggedIn = false; $role = 'guest'; $name = ''; } $initialState = json_encode([ 'logged_in' => $loggedIn, 'role' => $role, 'username' => $name, ], JSON_UNESCAPED_UNICODE); ?> SDF1 - 订单记录

📜 订单记录

← 返回收银台
· 退出 登录收银台

🔍 筛选与搜索

📋 订单列表

加载中…