|
@@ -46,7 +46,13 @@ class TeacherService extends CrudService {
|
|
|
const moment = require('moment');
|
|
|
let date = new Date();
|
|
|
date = moment(date).format('YYYY-MM-DD HH:mm:ss');
|
|
|
- await this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, teacher.openid, '您有一个新的通知', detail, date, remark);
|
|
|
+ const user = await this.umodel.findOne({ uid: teacher.id, type: '3' });
|
|
|
+ if (user && user.openid) {
|
|
|
+ await this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, teacher.openid, '您有一个新的通知', detail, date, remark);
|
|
|
+ } else {
|
|
|
+ await this.ctx.service.util.sendMail(teacher.email, '账号审核', detail, '');
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|