check-60.ts 762 B

123456789101112131415
  1. const { prisma } = require('../src/models');
  2. (async () => {
  3. const b = await prisma.book.findUnique({ where: { id: 60 }, select: { genStage: true, progress: true, id: true, title: true } });
  4. console.log('Book60:', JSON.stringify(b));
  5. const ch = await prisma.bookChapter.findMany({ where: { bookId: 60 }, select: { id: true, genStage: true, content: true } });
  6. for (const c of ch) console.log(` ch${c.id}: ${c.genStage} content=${(c.content||'').length}`);
  7. const total = await prisma.aiCallLog.count();
  8. const byType = await prisma.aiCallLog.groupBy({ by: ['callType'], _count: { id: true } });
  9. console.log('\nAiCallLog:', total);
  10. for (const t of byType) console.log(` ${t.callType}: ${t._count.id}`);
  11. await prisma.$disconnect();
  12. })();