| 123456789101112131415161718192021222324 |
- const { PrismaClient } = require('@prisma/client');
- const prisma = new PrismaClient();
- async function checkBooks() {
- const books = await prisma.book.findMany({
- where: { id: { in: [3, 4] } },
- select: {
- id: true,
- title: true,
- status: true,
- progress: true,
- errorMsg: true,
- }
- });
-
- console.log('书籍状态:');
- books.forEach(b => {
- console.log(`bookId=${b.id}, title=${b.title}, status=${b.status}, progress=${b.progress}%, error=${b.errorMsg || '无'}`);
- });
-
- await prisma.$disconnect();
- }
- checkBooks().catch(console.error);
|