notice_push.js 643 B

1234567891011121314151617181920212223242526272829303132333435
  1. 'use strict';
  2. /**
  3. * 推送表模型
  4. *
  5. * @author LanJianRong
  6. * @date 2017/11/16
  7. * @version
  8. */
  9. module.exports = app => {
  10. class NoticePush extends app.BaseService {
  11. /**
  12. * 构造函数
  13. *
  14. * @param {Object} ctx - egg全局变量
  15. * @return {void}
  16. */
  17. constructor(ctx) {
  18. super(ctx);
  19. this.tableName = 'notice';
  20. }
  21. /**
  22. * 将未读记录设置成已读
  23. * @param {Number} id 推送记录id
  24. */
  25. async set(id) {
  26. await this.update({ is_read: 1 }, { id });
  27. }
  28. }
  29. return NoticePush;
  30. };