|
@@ -80,15 +80,15 @@ class LeaveService extends CrudService {
|
|
const date = await this.ctx.service.util.updatedate();
|
|
const date = await this.ctx.service.util.updatedate();
|
|
this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, openid, '您有一个新的通知', toOtherMsg, date, remark);
|
|
this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, openid, '您有一个新的通知', toOtherMsg, date, remark);
|
|
}
|
|
}
|
|
- // const _class = await this.cmodel.findById(student.classid);
|
|
|
|
- // // 通知班主任学生请假通过
|
|
|
|
- // const headteacherid = _class.headteacherid;
|
|
|
|
- // const headuser = await this.umodel.findOne({ uid: headteacherid, type: '1' });
|
|
|
|
- // if (headuser) {
|
|
|
|
- // const openid = headuser.openid;
|
|
|
|
- // const date = await this.ctx.service.util.updatedate();
|
|
|
|
- // this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, openid, '您有一个新的通知', toOtherMsg, date, remark);
|
|
|
|
- // }
|
|
|
|
|
|
+ const _class = await this.cmodel.findById(student.classid);
|
|
|
|
+ // 通知班主任学生请假通过
|
|
|
|
+ const headteacherid = _class.headteacherid;
|
|
|
|
+ const headuser = await this.umodel.findOne({ uid: headteacherid, type: '1' });
|
|
|
|
+ if (headuser) {
|
|
|
|
+ const openid = headuser.openid;
|
|
|
|
+ const date = await this.ctx.service.util.updatedate();
|
|
|
|
+ this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, openid, '您有一个新的通知', toOtherMsg, date, remark);
|
|
|
|
+ }
|
|
// const leadstu = await this.smodel.findOne({ classid: student.classid, job: '班长' });
|
|
// const leadstu = await this.smodel.findOne({ classid: student.classid, job: '班长' });
|
|
// if (leadstu) {
|
|
// if (leadstu) {
|
|
// const leaduser = await await this.umodel.findOne({ uid: leadstu.id, type: '4' });
|
|
// const leaduser = await await this.umodel.findOne({ uid: leadstu.id, type: '4' });
|