| 1234567891011121314151617181920212223 |
- const { PrismaClient } = require('@prisma/client');
- const prisma = new PrismaClient();
- async function checkBook2Chapters() {
- const bookId = 2;
-
- const chapters = await prisma.bookChapter.findMany({
- where: { bookId, level: 1 },
- orderBy: { number: 'asc' },
- select: { id: true, number: true, title: true, status: true }
- });
-
- console.log(`bookId=${bookId} 的章列表:`);
- chapters.forEach(c => {
- console.log(` 章${c.number}: ${c.title.substring(0, 30)}... (status: ${c.status})`);
- });
-
- console.log(`\n总共: ${chapters.length} 章`);
-
- await prisma.$disconnect();
- }
- checkBook2Chapters().catch(console.error);
|