<?php
require_once 'config.php';

// AJAX 获取联系方式
if (isset($_GET['id'])) {
    $id = (int)$_GET['id'];
    $stmt = $pdo->prepare("SELECT wechat FROM dating_profiles WHERE id = ? AND is_active = 1");
    $stmt->execute([$id]);
    $profile = $stmt->fetch(PDO::FETCH_ASSOC);
    
    header('Content-Type: application/json');
    if ($profile) {
        echo json_encode(['wechat' => $profile['wechat'] ?: '未公开']);
    } else {
        echo json_encode(['wechat' => '未找到']);
    }
    exit;
}
?>