/**
 * 检查提现记录的收款码信息
 */

require('dotenv').config();
const { sequelize } = require('../config/database');
const Withdrawal = require('../models/Withdrawal');

async function checkWithdrawals() {
  try {
    const withdrawals = await Withdrawal.findAll({
      limit: 5,
      order: [['createdAt', 'DESC']]
    });
    
    console.log('最近5条提现记录:');
    withdrawals.forEach((w, i) => {
      console.log(`\n--- 记录 ${i + 1} ---`);
      console.log('提现单号:', w.withdrawalNo);
      console.log('支付方式:', w.paymentMethod);
      console.log('支付详情:', JSON.stringify(w.paymentDetails, null, 2));
    });
    
  } catch (error) {
    console.error('查询失败:', error.message);
  } finally {
    await sequelize.close();
  }
}

checkWithdrawals();
