|
|
@@ -1115,7 +1115,7 @@ class ExamTypeStrategy
|
|
|
{
|
|
|
try {
|
|
|
// 如果章节数较少,使用原有逻辑
|
|
|
- if (count($chapterIds) <= 5) {
|
|
|
+ if (count($chapterIds) <= 15) {
|
|
|
Log::info('ExamTypeStrategy: 章节数较少,使用原有逻辑', [
|
|
|
'chapter_count' => count($chapterIds)
|
|
|
]);
|
|
|
@@ -1240,17 +1240,12 @@ class ExamTypeStrategy
|
|
|
{
|
|
|
try {
|
|
|
// 修复方案1:使用GROUP BY替代DISTINCT,并选择需要的字段
|
|
|
- $kpCodes = DB::table('textbook_chapter_knowledge_relation as tckr')
|
|
|
- ->leftJoin('textbook_catalog_nodes as tcn', 'tckr.catalog_chapter_id', '=', 'tcn.id')
|
|
|
- ->whereIn('tckr.catalog_chapter_id', $chapterIds)
|
|
|
- ->select('tckr.kp_code', 'tcn.sort_order')
|
|
|
- ->orderBy('tcn.sort_order', 'asc')
|
|
|
- ->orderBy('tckr.kp_code', 'asc')
|
|
|
- ->limit($limit)
|
|
|
- ->groupBy('tckr.kp_code')
|
|
|
- ->pluck('tckr.kp_code')
|
|
|
+ $kpCodes = DB::table('textbook_chapter_knowledge_relation')
|
|
|
+ ->whereIn('catalog_chapter_id', $chapterIds)
|
|
|
+ ->select('kp_code')
|
|
|
+ ->groupBy('kp_code')
|
|
|
+ ->pluck('kp_code')
|
|
|
->toArray();
|
|
|
-
|
|
|
Log::debug('ExamTypeStrategy: 查询章节知识点(原有逻辑)', [
|
|
|
'chapter_count' => count($chapterIds),
|
|
|
'found_kp_count' => count($kpCodes)
|