[ "学历要求" => "本科", "学位要求" => "学士学位", "年龄要求" => "无", "性别要求" => "不限制", "民族要求" => "无", "政治面貌要求" => "无", "专业-本科" => "教育学", "专业-硕士" => "教育学、心理学" ] ]; $resume = [ "birth_date" => "1998-03-01", "gender" => "男", "work_experience" => "无基层工作年限", "education" => [ [ "education_level" => "普通本科", "degree" => "学士", "majors_name" => "教育学" ], [ "education_level" => "硕士研究生", "degree" => "硕士", "majors_name" => "伦理学" ] ] ]; // 加载ThinkPHP框架 $app = new think\App(); $app->initialize(); // 创建匹配服务实例 $matchService = new app\service\MatchService(); // 计算匹配度 $score = $matchService->calculateMatchScore($position, $resume); echo "========================================\n"; echo "测试结果\n"; echo "========================================\n"; echo "匹配度分数: {$score}/100分\n"; echo "\n"; // 检查硬性条件 echo "岗位要求:\n"; echo "- 学历要求: " . $position['position_require']['学历要求'] . "\n"; echo "- 学位要求: " . $position['position_require']['学位要求'] . "\n"; echo "- 年龄要求: " . $position['position_require']['年龄要求'] . "\n"; echo "- 性别要求: " . $position['position_require']['性别要求'] . "\n"; echo "- 专业-本科: " . $position['position_require']['专业-本科'] . "\n"; echo "- 专业-硕士: " . $position['position_require']['专业-硕士'] . "\n"; echo "\n"; echo "简历信息:\n"; echo "- 最高学历: " . $resume['education'][1]['education_level'] . "\n"; echo "- 最高学位: " . $resume['education'][1]['degree'] . "\n"; echo "- 专业: "; foreach ($resume['education'] as $edu) { echo $edu['majors_name'] . " "; } echo "\n"; $age = date('Y') - date('Y', strtotime($resume['birth_date'])); if (date('md') < date('md', strtotime($resume['birth_date']))) { $age--; } echo "- 年龄: {$age}岁\n"; echo "- 性别: " . $resume['gender'] . "\n"; echo "========================================\n";