admin.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
  4. //
  5. class AdminController extends Controller {
  6. constructor(ctx) {
  7. super(ctx);
  8. this.service = this.ctx.service.statistics.admin;
  9. }
  10. async todo() {
  11. const res = await this.service.todo(this.ctx.query);
  12. this.ctx.ok({ data: res });
  13. }
  14. async stockWarning() {
  15. const res = await this.service.stockWarning(this.ctx.query);
  16. this.ctx.ok({ data: res });
  17. }
  18. async notDealAfterSale() {
  19. const res = await this.service.notDealAfterSale(this.ctx.query);
  20. this.ctx.ok({ data: res });
  21. }
  22. async notSend() {
  23. const res = await this.service.notSend(this.ctx.query);
  24. this.ctx.ok({ data: res });
  25. }
  26. async notPay() {
  27. const res = await this.service.notPay(this.ctx.query);
  28. this.ctx.ok({ data: res });
  29. }
  30. async makeOrder() {
  31. const res = await this.service.makeOrder(this.ctx.query);
  32. this.ctx.ok({ data: res });
  33. }
  34. async makeAfterSale() {
  35. const res = await this.service.makeAfterSale(this.ctx.query);
  36. this.ctx.ok({ data: res });
  37. }
  38. async sellTotal() {
  39. const res = await this.service.sellTotal(this.ctx.query);
  40. this.ctx.ok({ data: res });
  41. }
  42. }
  43. module.exports = CrudController(AdminController, {});