refactor: stdLearning history function

This commit is contained in:
elangptra 2024-10-24 09:19:12 +07:00
parent 522090886c
commit f88da97055

View File

@ -252,6 +252,9 @@ export const learningHistory = async (req, res) => {
const stdLearnings = await models.StdLearning.findAll({ const stdLearnings = await models.StdLearning.findAll({
where: { ID }, where: { ID },
STUDENT_FINISH: {
[models.Sequelize.Op.ne]: null,
},
include: [ include: [
{ {
model: models.Level, model: models.Level,
@ -349,6 +352,9 @@ export const learningHistoryBySectionId = async (req, res) => {
const stdLearnings = await models.StdLearning.findAll({ const stdLearnings = await models.StdLearning.findAll({
where: { ID }, where: { ID },
STUDENT_FINISH: {
[models.Sequelize.Op.ne]: null,
},
include: [ include: [
{ {
model: models.Level, model: models.Level,
@ -451,6 +457,9 @@ export const learningHistoryByTopicId = async (req, res) => {
const stdLearnings = await models.StdLearning.findAll({ const stdLearnings = await models.StdLearning.findAll({
where: { ID }, where: { ID },
STUDENT_FINISH: {
[models.Sequelize.Op.ne]: null,
},
include: [ include: [
{ {
model: models.Level, model: models.Level,