upd some queries wit question.auditory
This commit is contained in:
parent
05b39805d5
commit
554d93283c
@ -324,7 +324,7 @@ SELECT DISTINCT on (question_id) id, content, quiz_id, question_id, fingerprint,
|
||||
SELECT session FROM answer WHERE answer.id = $1) ORDER BY question_id, created_at DESC;
|
||||
|
||||
-- name: GetQuestions :many
|
||||
SELECT id, quiz_id, title, description, questiontype, required, deleted, page, content, version, parent_ids, created_at, updated_at FROM question WHERE quiz_id = $1 AND deleted = FALSE ORDER BY page ASC;
|
||||
SELECT id, quiz_id, title, description, questiontype, required, deleted, page, content, version, parent_ids, created_at, updated_at,auditory FROM question WHERE quiz_id = $1 AND deleted = FALSE ORDER BY page ASC;
|
||||
|
||||
-- name: SoftDeleteResultByID :exec
|
||||
UPDATE answer SET deleted = TRUE WHERE id = $1 AND deleted = FALSE;
|
||||
@ -1093,7 +1093,7 @@ INSERT INTO amoContact (AccountID, AmoID, Field) VALUES ($1, $2, $3) RETURNING A
|
||||
UPDATE amoContact SET Field = $1,AmoID=$3 WHERE ID = $2;
|
||||
|
||||
-- name: GetQuestionsAI :many
|
||||
SELECT q.id, q.quiz_id, q.title, q.description, q.questiontype, q.required, q.deleted, q.page, q.content, q.version, q.parent_ids, q.created_at, q.updated_at, q.session FROM question q
|
||||
SELECT q.id, q.quiz_id, q.title, q.description, q.questiontype, q.required, q.deleted, q.page, q.content, q.version, q.parent_ids, q.created_at, q.updated_at, q.session,q.auditory FROM question q
|
||||
WHERE q.quiz_id = $1 AND (q.session = $2 OR q.session = '') AND q.deleted = FALSE
|
||||
ORDER BY (q.session != '') ASC, --без сессии первые потом с сессией
|
||||
q.page, --по возрастанию страницы
|
||||
|
@ -164,6 +164,7 @@ func (r *QuestionRepository) GetQuestionList(
|
||||
&piece.CreatedAt,
|
||||
&piece.UpdatedAt,
|
||||
&piece.Session,
|
||||
&piece.Auditory,
|
||||
); err != nil {
|
||||
qerr = err
|
||||
return
|
||||
@ -283,6 +284,7 @@ func (r *QuestionRepository) DeleteQuestion(ctx context.Context, id uint64) (mod
|
||||
ParentIds: row.ParentIds,
|
||||
CreatedAt: row.CreatedAt.Time,
|
||||
UpdatedAt: row.UpdatedAt.Time,
|
||||
Auditory: row.Auditory,
|
||||
}
|
||||
|
||||
return result, nil
|
||||
@ -370,6 +372,7 @@ func (r *QuestionRepository) QuestionHistory(ctx context.Context, id, limit, off
|
||||
ParentIds: row.ParentIds,
|
||||
CreatedAt: row.CreatedAt.Time,
|
||||
UpdatedAt: row.UpdatedAt.Time,
|
||||
Auditory: row.Auditory,
|
||||
}
|
||||
result = append(result, record)
|
||||
}
|
||||
@ -486,6 +489,7 @@ func (r *QuestionRepository) GetQuestionListByIDs(ctx context.Context, ids []int
|
||||
ParentIds: row.ParentIds,
|
||||
CreatedAt: row.CreatedAt.Time,
|
||||
UpdatedAt: row.UpdatedAt.Time,
|
||||
Auditory: row.Auditory,
|
||||
}
|
||||
|
||||
questions = append(questions, question)
|
||||
@ -524,6 +528,7 @@ func (r *QuestionRepository) GetQuestionsAI(ctx context.Context, quizID int64, s
|
||||
CreatedAt: row.CreatedAt.Time,
|
||||
UpdatedAt: row.UpdatedAt.Time,
|
||||
Session: row.Session,
|
||||
Auditory: row.Auditory,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -218,6 +218,7 @@ func (r *ResultRepository) GetQuestions(ctx context.Context, quizID uint64) ([]m
|
||||
ParentIds: row.ParentIds,
|
||||
CreatedAt: row.CreatedAt.Time,
|
||||
UpdatedAt: row.UpdatedAt.Time,
|
||||
Auditory: row.Auditory,
|
||||
}
|
||||
|
||||
questions = append(questions, question)
|
||||
|
Loading…
Reference in New Issue
Block a user