|
@@ -361,7 +361,9 @@ class LessonService extends CrudService {
|
|
|
const teacherList = _.compact(_.uniq(lessons.map(i => i.teaid)));
|
|
|
if (teacherList) {
|
|
|
for (const tea of teacherList) {
|
|
|
- const r = await this.toSendMsg(tea, 'teacher', termnum, nres._id, content);
|
|
|
+ const teacher = await this.teamodel.findById(tea);
|
|
|
+ if (!teacher) continue;
|
|
|
+ const r = await this.toSendMsg(teacher, 'teacher', termnum, nres._id, content);
|
|
|
if (r && is_update) nres.notified.push(r);
|
|
|
else if (r && !is_update) {
|
|
|
const dr = nres.notified.find(f => f.notifiedid === r.notifiedid);
|