|
@@ -389,8 +389,14 @@ class LessonService extends CrudService {
|
|
|
}
|
|
|
}
|
|
|
// 查出openid,email
|
|
|
- const { openid, email } = await this.getSendInfo(headteacherid);
|
|
|
- return { openid, email, notifiedid: headteacherid, username: headteacher, content: msg, ncontent: `${term}期-${batch}批-${name.includes('班') ? name : `${name}班`}课表确认` };
|
|
|
+ const info = await this.getSendInfo(headteacherid);
|
|
|
+ const obj = { notifiedid: headteacherid, username: headteacher, content: msg, ncontent: `${term}期-${batch}批-${name.includes('班') ? name : `${name}班`}课表确认` };
|
|
|
+ if (info) {
|
|
|
+ const { openid, email } = info;
|
|
|
+ obj.openid = openid;
|
|
|
+ obj.email = email;
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
}
|
|
|
// 给教师发送信息
|
|
|
async getTeacherMsg(classInfo, lessonInfo) {
|
|
@@ -417,8 +423,14 @@ class LessonService extends CrudService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- const { openid, email } = await this.getSendInfo(lessonInfo.teaid);
|
|
|
- return { openid, email, notifiedid: _.get(lessonInfo, 'teaid'), username: _.get(lessonInfo, 'teaname'), content: msg, ncontent: `${term}期-${batch}批-${name.includes('班') ? name : `${name}班`}课表确认` };
|
|
|
+ const info = await this.getSendInfo(lessonInfo.teaid);
|
|
|
+ const obj = { notifiedid: _.get(lessonInfo, 'teaid'), username: _.get(lessonInfo, 'teaname'), content: msg, ncontent: `${term}期-${batch}批-${name.includes('班') ? name : `${name}班`}课表确认` };
|
|
|
+ if (info) {
|
|
|
+ const { openid, email } = info;
|
|
|
+ obj.openid = openid;
|
|
|
+ obj.email = email;
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
}
|
|
|
|
|
|
// 给礼仪教师发送信息
|
|
@@ -437,8 +449,14 @@ class LessonService extends CrudService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- const { openid, email } = await this.getSendInfo(lyteacherid);
|
|
|
- return { openid, email, notifiedid: lyteacherid, username: lyteacher, content: msg, ncontent: `${term}期-${batch}批-${name.includes('班') ? name : `${name}班`}课表确认` };
|
|
|
+ const info = await this.getSendInfo(lyteacherid);
|
|
|
+ const obj = { notifiedid: lyteacherid, username: lyteacher, content: msg, ncontent: `${term}期-${batch}批-${name.includes('班') ? name : `${name}班`}课表确认` };
|
|
|
+ if (info) {
|
|
|
+ const { openid, email } = info;
|
|
|
+ obj.openid = openid;
|
|
|
+ obj.email = email;
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
}
|
|
|
|
|
|
// 查找openid和emaiil
|