import { PrismaClient } from "@prisma/client"; const prisma = new PrismaClient({ log: ["error"] }); const u = await prisma.user.findMany({ where: { phone: { not: null } }, select: { id: true, phone: true, nickname: true }, orderBy: { id: "asc" }, }); console.log("现有手机号用户:"); for (const r of u) console.log(` user_id=${r.id} phone=${r.phone} name=${r.nickname}`); await prisma.$disconnect();