table.js 517 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const { CrudService } = require('naf-framework-mongoose-free/lib/service');
  3. class TableService extends CrudService {
  4. constructor(ctx) {
  5. super(ctx, 'table');
  6. this.model = this.ctx.model.Table;
  7. }
  8. async query(condition) {
  9. condition = this.turnFilter(this.turnDateRangeQuery(condition));
  10. console.log(condition);
  11. const res = await this.model.find(condition);
  12. console.log(res);
  13. }
  14. async count(condition) {
  15. console.log(condition);
  16. }
  17. }
  18. module.exports = TableService;