题库增加题目数量展示
This commit is contained in:
@@ -18,6 +18,16 @@ type QuestionListParams struct {
|
||||
PageSize int
|
||||
}
|
||||
|
||||
// CountQuestionsInBank 统计指定题库下的题目数量(仅统计未删除且启用的题目)
|
||||
func CountQuestionsInBank(tenantId int, bankId int64) (int64, error) {
|
||||
o := orm.NewOrm()
|
||||
qs := o.QueryTable(new(models.ExamQuestion)).Filter("delete_time__isnull", true).Filter("status", 1).Filter("bank_id", bankId)
|
||||
if tenantId > 0 {
|
||||
qs = qs.Filter("tenant_id", tenantId)
|
||||
}
|
||||
return qs.Count()
|
||||
}
|
||||
|
||||
type QuestionWithMeta struct {
|
||||
Question *models.ExamQuestion
|
||||
Options []*models.ExamQuestionOption
|
||||
|
||||
Reference in New Issue
Block a user