|
@@ -89,19 +89,19 @@ class LeaveService extends CrudService {
|
|
|
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: '班长' });
|
|
|
- // if (leadstu) {
|
|
|
- // const leaduser = await await this.umodel.findOne({ uid: leadstu.id, type: '4' });
|
|
|
- // if (leaduser) {
|
|
|
- // const openid = leaduser.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 stuopenid = stuuser.openid;
|
|
|
- // detail = '您的请假申请已通过,请及时查收!';
|
|
|
- // const date = await this.ctx.service.util.updatedate();
|
|
|
- // await this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, stuopenid, '您有一个新的通知', detail, date, remark);
|
|
|
+ const leadstu = await this.smodel.findOne({ classid: student.classid, job: '班长' });
|
|
|
+ if (leadstu) {
|
|
|
+ const leaduser = await await this.umodel.findOne({ uid: leadstu.id, type: '4' });
|
|
|
+ if (leaduser) {
|
|
|
+ const openid = leaduser.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 stuopenid = stuuser.openid;
|
|
|
+ detail = '您的请假申请已通过,请及时查收!';
|
|
|
+ const date = await this.ctx.service.util.updatedate();
|
|
|
+ await this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, stuopenid, '您有一个新的通知', detail, date, remark);
|
|
|
|
|
|
}
|
|
|
if (status === '2') {
|