|
@@ -89,11 +89,14 @@ class BedroomService extends CrudService {
|
|
|
// 取得每个班级的班主任id
|
|
|
const headteacherid = _class.headteacherid;
|
|
|
const headteacher = await this.umodel.findOne({ uid: headteacherid, type: '1' });
|
|
|
- const openid = headteacher.openid;
|
|
|
- const remark = '感谢您的使用';
|
|
|
- const date = await this.ctx.service.util.updatedate();
|
|
|
- const detail = '班级学生名单与寝室安排已确认,请及时查收';
|
|
|
- this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, openid, '您有一个新的通知', detail, date, remark, _class.id);
|
|
|
+ if (headteacher.openid) {
|
|
|
+ const openid = headteacher.openid;
|
|
|
+ const remark = '感谢您的使用';
|
|
|
+ const date = await this.ctx.service.util.updatedate();
|
|
|
+ const detail = '班级学生名单与寝室安排已确认,请及时查收';
|
|
|
+ this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, openid, '您有一个新的通知', detail, date, remark, _class.id);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|