total.js 399 B

123456789101112131415
  1. 'use strict';
  2. const Service = require('egg').Service;
  3. class TotalService extends Service {
  4. // 用户 总数
  5. async totaluser({ filter, _this }) {
  6. return await _this.ctx.model.User.estimatedDocumentCount({ ...filter });
  7. }
  8. // vip 总数
  9. async totalvip({ filter, _this }) {
  10. return await _this.ctx.model.Vip.estimatedDocumentCount({ ...filter });
  11. }
  12. }
  13. module.exports = TotalService;