Commit 25ff22ca authored by 任国军's avatar 任国军

fix report created_time bug

parent c033009e
Pipeline #22634 passed with stage
in 3 seconds
......@@ -75,7 +75,8 @@ class ReportService extends Service {
if (ctx.isEmpty(userReport)) {
await ctx.classModel.V5.CourseUserReport.findOrCreate({ where: { user_uuid: ctx.userUuid, cat_id: input.cat_id, status: 1, is_deleted: 0 }, defaults: result });
} else {
await ctx.classModel.V5.CourseUserReport.update(result, { where: { id: userReport.id } });
await ctx.classModel.V5.CourseUserReport.update({ is_deleted: 1 }, { where: { user_uuid: ctx.userUuid, cat_id: input.cat_id, status: 1, is_deleted: 0 } });
await ctx.classModel.V5.CourseUserReport.findOrCreate({ where: { user_uuid: ctx.userUuid, cat_id: input.cat_id, status: 1, is_deleted: 0 }, defaults: result });
}
const report = await this.getReportByCategory(input.cat_id);
......
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