const { PrismaClient } = require('@prisma/client');
const prisma = new PrismaClient();

async function updateMemberLevel() {
  try {
    const user = await prisma.user.update({
      where: { id: 1 },
      data: { 
        memberLevel: 2,
        memberExpireAt: new Date('2027-12-31') // 设置到期时间
      }
    });
    
    console.log('✅ 会员等级已更新为2（年度会员 - 无限制）');
    console.log('用户信息:');
    console.log(`  ID: ${user.id}`);
    console.log(`  手机: ${user.phone}`);
    console.log(`  会员等级: ${user.memberLevel}`);
    console.log(`  到期时间: ${user.memberExpireAt}`);
    console.log(`  每日使用: ${user.dailyUsage}`);
  } catch (error) {
    console.error('错误:', error);
  } finally {
    await prisma.$disconnect();
  }
}

updateMemberLevel();
