reloaded 5 년 전
부모
커밋
238417c053
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      app/service/trainplan.js

+ 3 - 1
app/service/trainplan.js

@@ -66,7 +66,9 @@ class TrainplanService extends CrudService {
         let date = new Date();
         date = moment(date).format('YYYY-MM-DD HH:mm:ss');
         const remark = '感谢您的使用';
-        this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, openid, '您有一个新的通知', detail, date, remark);
+        if (openid) {
+          this.ctx.service.weixin.sendTemplateMsg(this.ctx.app.config.REVIEW_TEMPLATE_ID, openid, '您有一个新的通知', detail, date, remark);
+        }
       }
       // 查询所有学校用户
       const schools = await this.umodel.find({ type: '2' });