This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
carwash_order/test/vip_debug_page.html
T
wsh5485 0eb0cf12fb chore: 删除测试和调试相关文件
移除不再需要的测试脚本、调试页面和解决方案文档,包括:
- 各种测试PHP文件(test.php, test_filters.php等)
- VIP功能测试和调试页面(test_vip*.php, vip_debug_page.html等)
- 数据库连接测试脚本(test_db_connection.php)
- 解决方案文档(SOLUTIONS.md, VIP_*_Report.md)
2025-12-05 01:38:06 +08:00

173 lines
6.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>VIP客户功能调试页面</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
max-width: 800px;
margin: 0 auto;
padding: 20px;
color: #333;
}
h1, h2, h3 {
color: #2c3e50;
}
.container {
background: #f9f9f9;
border-radius: 8px;
padding: 20px;
margin-bottom: 20px;
}
.debug-button {
background: #3498db;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
text-decoration: none;
display: inline-block;
margin-top: 10px;
}
.debug-button:hover {
background: #2980b9;
}
.info-box {
background: #e8f4fc;
border-left: 4px solid #3498db;
padding: 15px;
margin: 15px 0;
}
.warning-box {
background: #fff8e1;
border-left: 4px solid #ffc107;
padding: 15px;
margin: 15px 0;
}
.error-box {
background: #ffeaea;
border-left: 4px solid #e74c3c;
padding: 15px;
margin: 15px 0;
}
code {
background: #eee;
padding: 2px 5px;
border-radius: 3px;
font-family: monospace;
}
table {
width: 100%;
border-collapse: collapse;
margin: 15px 0;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background: #f2f2f2;
}
</style>
</head>
<body>
<h1>VIP客户功能调试指南</h1>
<div class="container">
<h2>问题分析</h2>
<div class="info-box">
<p>从调试日志可以看出,当搜索手机号 <code>18699627661</code> 时,系统显示 "数据库中VIP客户数: 0",这表明系统无法从数据库中加载到VIP客户数据。</p>
</div>
<h3>可能的原因</h3>
<ul>
<li>数据库连接问题</li>
<li>数据表不存在或结构不正确</li>
<li>表中没有活跃的VIP客户数据</li>
<li>用户提到的手机号不在VIP客户表中</li>
</ul>
</div>
<div class="container">
<h2>调试工具</h2>
<p>请点击下方按钮运行数据库调试脚本,该脚本将帮助您检查:</p>
<ol>
<li>数据库连接配置</li>
<li>数据库连接状态</li>
<li>VIP客户表是否存在</li>
<li>VIP客户表结构</li>
<li>VIP客户数据</li>
<li>特定手机号的查询结果</li>
</ol>
<a href="debug_vip_db.php" class="debug-button" target="_blank">运行数据库调试脚本</a>
</div>
<div class="container">
<h2>常见问题排查步骤</h2>
<h3>1. 检查数据库连接</h3>
<div class="info-box">
<p>确保 <code>config.php</code> 文件中的数据库配置正确:</p>
<ul>
<li>主机地址(通常为 localhost</li>
<li>数据库名(应为 carwash_booking</li>
<li>用户名(通常为 root</li>
<li>密码(可能为空)</li>
</ul>
</div>
<h3>2. 确认数据库表结构</h3>
<div class="info-box">
<p>根据系统代码,VIP客户数据应存储在 <code>vip_customers</code> 表中,而不是用户提到的 <code>vip</code> 表。请确认数据库中是否存在正确的表。</p>
</div>
<h3>3. 验证VIP客户数据</h3>
<div class="warning-box">
<p>从数据库脚本中看,系统已包含3个示例VIP客户,但没有包含手机号 <code>18699627661</code>。您可以通过调试脚本中的功能插入这个手机号作为测试数据。</p>
</div>
<h3>4. 检查get_vip_customers.php</h3>
<div class="info-box">
<p>确保 <code>get_vip_customers.php</code> 文件中的SQL查询正确,它应该查询 <code>vip_customers</code> 表且过滤条件为 <code>is_active = 1</code></p>
</div>
</div>
<div class="container">
<h2>解决方案</h2>
<ol>
<li>运行数据库调试脚本,查看详细的数据库状态</li>
<li>如果表不存在,使用提供的 <code>carwash_db.sql</code> 脚本创建数据库结构</li>
<li>如果数据缺失,通过调试脚本插入测试数据或直接向数据库添加VIP客户</li>
<li>确认手机号格式是否正确,系统会自动移除手机号中的非数字字符</li>
</ol>
<div class="error-box">
<p><strong>注意:</strong>如果您的系统确实使用 <code>vip</code> 表而非 <code>vip_customers</code> 表,您需要修改 <code>get_vip_customers.php</code> 文件中的SQL查询语句,将表名从 <code>vip_customers</code> 更改为 <code>vip</code></p>
</div>
</div>
<div class="container">
<h2>快速修复选项</h2>
<p>如果您确定应该使用 <code>vip</code> 表而非 <code>vip_customers</code> 表,请点击下方按钮更新查询脚本:</p>
<a href="javascript:void(0)" onclick="updateTableQuery()" class="debug-button">更新为使用 vip 表</a>
<p style="margin-top: 20px;">如果您想保持使用 <code>vip_customers</code> 表但需要插入用户提到的手机号作为VIP客户,请点击:</p>
<a href="debug_vip_db.php#insert" class="debug-button" target="_blank">插入测试VIP数据</a>
</div>
<script>
function updateTableQuery() {
if (confirm('这将修改 get_vip_customers.php 文件,将表名从 vip_customers 更改为 vip。确定要继续吗?')) {
// 这里应该有AJAX请求来更新文件
alert('请手动编辑 get_vip_customers.php 文件,将 SQL 查询中的表名从 vip_customers 更改为 vip。');
}
}
</script>
</body>
</html>