feat: 添加调试日志并改进数据库处理逻辑

- 在多个文件中添加调试日志记录功能
- 将数据库连接统一迁移到db_connect.php
- 改进预约时间冲突检测逻辑
- 优化VIP客户数据处理
- 增强套餐查询的健壮性
- 更新预约状态处理流程
This commit is contained in:
2025-12-12 02:38:16 +08:00
parent 58fbb9f1e1
commit 905bbc5934
5 changed files with 240 additions and 192 deletions
+6 -2
View File
@@ -25,8 +25,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// 使用VIP客户信息
$customer_name = $vip_customer['customer_name'];
$phone = $vip_customer['phone'];
$car_model = $vip_customer['car_model'] ?: $car_model; // 允许覆盖
$car_number = $vip_customer['car_number'] ?: $car_number; // 允许覆盖
// #region agent log
$log_data = json_encode(['location' => 'index.php:28', 'message' => 'VIP customer data', 'data' => ['vip_id' => $vip_id, 'has_car_model' => isset($vip_customer['car_model']), 'has_car_number' => isset($vip_customer['car_number'])], 'timestamp' => time() * 1000, 'sessionId' => 'debug-session', 'runId' => 'run1', 'hypothesisId' => 'A']);
file_put_contents('.cursor/debug.log', $log_data . "\n", FILE_APPEND);
// #endregion
$car_model = isset($vip_customer['car_model']) && $vip_customer['car_model'] ? $vip_customer['car_model'] : ''; // 允许覆盖
$car_number = isset($vip_customer['car_number']) && $vip_customer['car_number'] ? $vip_customer['car_number'] : ''; // 允许覆盖
$member_type = 'VIP会员';
} else {
// 新客户录入