refactor: 移除测试代码并仅使用实际数据库数据

移除get_vip_last_booking.php和index.php中的测试代码和模拟数据功能,系统现在仅返回实际数据库中的预约记录数据
This commit is contained in:
2025-11-19 18:42:07 +08:00
parent 2e68b94aba
commit 7d81c77fac
2 changed files with 2 additions and 51 deletions
+1 -33
View File
@@ -1727,39 +1727,7 @@ $packages_json = json_encode(array_map(function($package) {
const infoContainer = document.getElementById('vip_last_booking_info');
const contentContainer = document.getElementById('last_booking_content');
infoContainer.style.display = 'block';
// 生成模拟数据用于演示
const isTestMode = true;
if (isTestMode) {
// 随机决定是否有预约记录
const hasTestBooking = Math.random() > 0.3;
if (hasTestBooking) {
// 模拟有预约记录
const testDate = new Date();
testDate.setDate(testDate.getDate() - Math.floor(Math.random() * 30) - 1);
const testTime = `${Math.floor(Math.random() * 12 + 9).toString().padStart(2, '0')}:${Math.floor(Math.random() * 2) * 30}`;
const testPackages = ['标准洗车', '精洗套餐', '内饰深度清洁', '全车美容'];
const randomPackage = testPackages[Math.floor(Math.random() * testPackages.length)];
const randomDuration = [30, 60, 90, 120][Math.floor(Math.random() * 4)];
contentContainer.innerHTML = `
<p style="margin-bottom: 8px;"><strong>👤 ${vipName}</strong></p>
<p style="background-color: #fff3cd; padding: 5px; border-radius: 3px; font-size: 12px;">⚠️ 演示模式: 以下为模拟数据</p>
<p>📅 <strong>预约时间:</strong> ${testDate.toISOString().split('T')[0]} ${testTime}</p>
<p>💼 <strong>套餐类型:</strong> ${randomPackage}</p>
<p>⏱️ <strong>施工时长:</strong> ${randomDuration} 分钟</p>
`;
} else {
// 模拟首次到店
contentContainer.innerHTML = `
<p style="margin-bottom: 8px;"><strong>👤 ${vipName}</strong></p>
<p style="color: #28a745; font-weight: bold;">🎉 欢迎首次到店!</p>
<p>这是该VIP客户的首次预约,请为客户提供优质服务体验。</p>
`;
}
} else {
contentContainer.innerHTML = `<p style="color: #dc3545;">无法获取预约记录,请稍后重试。</p>`;
}
contentContainer.innerHTML = `<p style="color: #dc3545;">无法获取预约记录,请稍后重试。</p>`;
});
}