Commit 89f104a4 authored by 任国军's avatar 任国军

getUsedRedeemCodeList add filter start/end time

parent 6059a95a
Pipeline #25490 passed with stage
in 5 seconds
......@@ -245,6 +245,16 @@ class BackService extends Service {
filter.where.class_id = { $in: filterClassIds };
}
if (!ctx.isEmpty(input.start_time)) {
if (!ctx.isEmpty(input.end_time)) {
filter.where.used_time = { $gte: input.start_time, $lte: input.end_time };
} else {
filter.where.used_time = { $gte: input.start_time };
}
} else if (!ctx.isEmpty(input.end_time)) {
filter.where.used_time = { $lte: input.end_time };
}
const redeemCodeList = await ctx.classModel.V5.CourseRedeemCode.findAndCountAll(filter);
if (ctx.isEmpty(redeemCodeList.rows)) {
return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment