|
@@ -118,7 +118,8 @@ class StudentKnowledgeMastery extends Model
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $levels = self::query()
|
|
|
|
|
|
|
+ // 使用 DB::table 避免 Eloquent accessor 把数字转成文字标签
|
|
|
|
|
+ $levels = \Illuminate\Support\Facades\DB::table('student_knowledge_mastery')
|
|
|
->where('student_id', $studentId)
|
|
->where('student_id', $studentId)
|
|
|
->whereIn('kp_code', $kpCodes)
|
|
->whereIn('kp_code', $kpCodes)
|
|
|
->pluck('mastery_level', 'kp_code')
|
|
->pluck('mastery_level', 'kp_code')
|
|
@@ -149,8 +150,8 @@ class StudentKnowledgeMastery extends Model
|
|
|
return true; // 没有知识点,视为达标
|
|
return true; // 没有知识点,视为达标
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 获取掌握度
|
|
|
|
|
- $levels = self::query()
|
|
|
|
|
|
|
+ // 获取掌握度(使用 DB::table 避免 Eloquent accessor 把数字转成文字标签)
|
|
|
|
|
+ $levels = \Illuminate\Support\Facades\DB::table('student_knowledge_mastery')
|
|
|
->where('student_id', $studentId)
|
|
->where('student_id', $studentId)
|
|
|
->whereIn('kp_code', $kpCodes)
|
|
->whereIn('kp_code', $kpCodes)
|
|
|
->pluck('mastery_level', 'kp_code')
|
|
->pluck('mastery_level', 'kp_code')
|
|
@@ -197,8 +198,8 @@ class StudentKnowledgeMastery extends Model
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 获取掌握度
|
|
|
|
|
- $levels = self::query()
|
|
|
|
|
|
|
+ // 获取掌握度(使用 DB::table 避免 Eloquent accessor 把数字转成文字标签)
|
|
|
|
|
+ $levels = \Illuminate\Support\Facades\DB::table('student_knowledge_mastery')
|
|
|
->where('student_id', $studentId)
|
|
->where('student_id', $studentId)
|
|
|
->whereIn('kp_code', $kpCodes)
|
|
->whereIn('kp_code', $kpCodes)
|
|
|
->pluck('mastery_level', 'kp_code')
|
|
->pluck('mastery_level', 'kp_code')
|