count.js 665 B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. const _ = require('lodash');
  3. const Controller = require('egg').Controller;
  4. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  5. // 教师申请讲课表管理
  6. class CountController extends Controller {
  7. constructor(ctx) {
  8. super(ctx);
  9. this.service = this.ctx.service.count;
  10. }
  11. // 统计全年计划所有学校
  12. async countstudent() {
  13. const data = await this.service.countstudent();
  14. this.ctx.ok({ data });
  15. }
  16. // 按学校统计学生情况
  17. async countschstu() {
  18. const data = await this.service.countschstu(this.ctx.params);
  19. this.ctx.ok({ data });
  20. }
  21. }
  22. module.exports = CountController;