chore: archive AI-generated docs/scripts from webroot into _ai_archive (docs/scripts/sql/logs), keep production entries
这个提交包含在:
54
_ai_archive/scripts/debug_users.php
可执行文件
54
_ai_archive/scripts/debug_users.php
可执行文件
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
// 调试用户数据
|
||||
require_once './ThinkPHP/ThinkPHP.php';
|
||||
|
||||
// 查询用户表数据
|
||||
$JurisdictionUserModel = D('JurisdictionUser');
|
||||
|
||||
echo "=== 查询用户表数据 ===\n";
|
||||
|
||||
// 查询所有活跃用户
|
||||
$users = $JurisdictionUserModel->where(array(
|
||||
'state' => 1,
|
||||
'status' => 1
|
||||
))->field('id,login_name,password,user_type,name,add_time')->limit(10)->select();
|
||||
|
||||
if ($users) {
|
||||
echo "找到 " . count($users) . " 个活跃用户:\n";
|
||||
foreach ($users as $user) {
|
||||
echo "ID: {$user['id']}, 登录名: {$user['login_name']}, 用户类型: {$user['user_type']}, 姓名: {$user['name']}, 添加时间: {$user['add_time']}\n";
|
||||
echo "密码哈希: " . substr($user['password'], 0, 20) . "...\n";
|
||||
echo "---\n";
|
||||
}
|
||||
} else {
|
||||
echo "未找到活跃用户\n";
|
||||
}
|
||||
|
||||
// 查询特定用户
|
||||
echo "\n=== 查询特定用户 13888888888 ===\n";
|
||||
$specificUser = $JurisdictionUserModel->where(array(
|
||||
'login_name' => '13888888888',
|
||||
'state' => 1,
|
||||
'status' => 1
|
||||
))->find();
|
||||
|
||||
if ($specificUser) {
|
||||
echo "找到用户:\n";
|
||||
print_r($specificUser);
|
||||
|
||||
// 测试密码验证
|
||||
echo "\n=== 测试密码验证 ===\n";
|
||||
$testPasswords = ['123456', '888888', 'admin', 'password'];
|
||||
|
||||
foreach ($testPasswords as $pwd) {
|
||||
$isValid = checkPassword($specificUser['password'], $pwd, $specificUser['add_time']);
|
||||
echo "密码 '{$pwd}': " . ($isValid ? '正确' : '错误') . "\n";
|
||||
}
|
||||
} else {
|
||||
echo "未找到用户 13888888888\n";
|
||||
}
|
||||
|
||||
// 显示最后执行的SQL
|
||||
echo "\n=== 最后执行的SQL ===\n";
|
||||
echo $JurisdictionUserModel->getLastSql() . "\n";
|
||||
?>
|
||||
在新工单中引用
屏蔽一个用户