lrf402788946 4 년 전
부모
커밋
0271a2e9b2
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      app/model/notice.js
  2. 2 2
      app/service/notice.js

+ 1 - 1
app/model/notice.js

@@ -4,7 +4,7 @@ const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 
 // 被通知详情表
 const notifiedInfo = new Schema({
-  notifiedid: { type: String, required: false, maxLength: 200 }, // 被通知人id,user表id
+  notifiedid: { type: String, required: false, maxLength: 200 }, // 被通知人id,user表uid
   username: { type: String, required: false, maxLength: 200 }, // 通知姓名
   status: { type: String, required: false, maxLength: 200, default: '0' }, // 状态,0-未读,1-已读
   readtime: { type: String, required: false, maxLength: 200 }, // 读取时间

+ 2 - 2
app/service/notice.js

@@ -64,10 +64,10 @@ class NoticeService extends CrudService {
       const remark = '感谢您的使用';
       const date = await this.ctx.service.util.updatedate();
       const detail = content;
-      const tourl = this.ctx.app.config.baseUrl + '/trainnotice/?userid=' + user._id + '&noticeid=' + res.id;
+      const tourl = this.ctx.app.config.baseUrl + '/trainnotice/?userid=' + user.uid + '&noticeid=' + res.id;
       this.ctx.service.weixin.sendTemplateDesign(this.ctx.app.config.REVIEW_TEMPLATE_ID, openid, '您有一个新的通知,请点击确认您已收到信息!', detail, date, remark, tourl);
       const notified = _.get(res, 'notified', []);
-      notified.push({ notifiedid: user._id, username: user.name });
+      notified.push({ notifiedid: user.uid, username: user.name });
       res.notified = notified;
     }
     res.save();