fix(bug):培训中心中的和信课程点开学习页面如图所示预览查看空间高度太小,展示高度需要满屏下方留出【下载课件】按钮高度即可
deploy-hxtesting / build-and-deploy (push) Successful in 1m15s
deploy-hxtesting / build-and-deploy (push) Successful in 1m15s
This commit is contained in:
1 parent
ce24d4b9cb
commit
353f60a175
3 files changed
+70
-32
No files matched your search
@@ -347,42 +347,54 @@ func (s *TrainingScheduler) generateForTenant(
|
||||
// 立即入队(training_notify.go),调度器不再发学员 remind_tN 重复打扰;
|
||||
// day_before 场次在 T-1 且课件就绪时在此入队(课件缺失跳过,上传课件后
|
||||
// 补推钩子兜底)。讲师 remind_tN_lecturer 授课提醒保持不变。
|
||||
// 000165 复测:多档提醒窗口(T-3/T-1)同时过期时(临近创建/改期的场次),
|
||||
// 一次扫描只发最近一档(按天升序取最小),避免同屏重复轰炸;
|
||||
// 正常节奏(提前数天创建)不受影响 —— 未到窗口的档位不会入选。
|
||||
dueDay := 0
|
||||
for _, d := range cfg.remindDays {
|
||||
if now.Before(start.Add(-time.Duration(d) * 24 * time.Hour)) {
|
||||
continue
|
||||
}
|
||||
if dueDay == 0 || d < dueDay {
|
||||
dueDay = d
|
||||
}
|
||||
}
|
||||
if dueDay > 0 {
|
||||
if sess.LecturerID != "" {
|
||||
rows := []*types.TrainingNotification{s.newReminderRow(tenantID, sess.LecturerID,
|
||||
types.TrainingRemindScene(d, true),
|
||||
types.TrainingRemindScene(dueDay, true),
|
||||
remindTitle(cfg.texts.LecturerOpenTitle, course), remindContent(course, &sess, false, cfg.texts.LecturerOpenFooter),
|
||||
sess.ID, cfg.pushEnabled, now)}
|
||||
if err := s.insertNotifications(ctx, tenantID, sess.ID, rows); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if sess.NotifyMode != types.TrainingNotifyModeDayBefore || d != 1 {
|
||||
continue
|
||||
}
|
||||
hasMaterial, err := s.courseHasMaterial(ctx, tenantID, sess.CourseID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !hasMaterial {
|
||||
continue
|
||||
}
|
||||
targets, err := s.sessionTargets(ctx, tenantID, sess)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rows := make([]*types.TrainingNotification, 0, len(targets))
|
||||
for _, uid := range targets {
|
||||
rows = append(rows, s.newReminderRow(tenantID, uid,
|
||||
types.SceneSessionNoticeStudent,
|
||||
remindTitle(cfg.texts.StudentNoticeTitle, course), remindContent(course, &sess, false, cfg.texts.LecturerOpenFooter),
|
||||
sess.ID, cfg.pushEnabled, now))
|
||||
}
|
||||
if err := s.insertNotifications(ctx, tenantID, sess.ID, rows); err != nil {
|
||||
return err
|
||||
if sess.NotifyMode == types.TrainingNotifyModeDayBefore && dueDay == 1 {
|
||||
hasMaterial, err := s.courseHasMaterial(ctx, tenantID, sess.CourseID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if hasMaterial {
|
||||
targets, err := s.sessionTargets(ctx, tenantID, sess)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rows := make([]*types.TrainingNotification, 0, len(targets))
|
||||
for _, uid := range targets {
|
||||
// 讲师已有同场次的授课提醒(remind_t1_lecturer),
|
||||
// 学员通知跳过讲师,避免同一人收到两条相同内容
|
||||
if sess.LecturerID != "" && uid == sess.LecturerID {
|
||||
continue
|
||||
}
|
||||
rows = append(rows, s.newReminderRow(tenantID, uid,
|
||||
types.SceneSessionNoticeStudent,
|
||||
remindTitle(cfg.texts.StudentNoticeTitle, course), remindContent(course, &sess, false, cfg.texts.LecturerOpenFooter),
|
||||
sess.ID, cfg.pushEnabled, now))
|
||||
}
|
||||
if err := s.insertNotifications(ctx, tenantID, sess.ID, rows); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user