reward_order.js 722 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const { CrudService } = require('naf-framework-mongoose/lib/service');
  3. const { BusinessError, ErrorCode } = require('naf-core').Error;
  4. const _ = require('lodash');
  5. const assert = require('assert');
  6. const moment = require('moment');
  7. // 研发补贴,奖励兑换订单
  8. class Reward_orderService extends CrudService {
  9. constructor(ctx) {
  10. super(ctx, 'reward_order');
  11. this.model = this.ctx.model.RewardOrder;
  12. }
  13. async create(body) {
  14. const no = `${moment().format('YYYYMMDD')}${moment().format('x')}DF`;
  15. const create_time = moment().format('YYYY-MM-DD HH:mm:ss');
  16. body = { ...body, no, create_time };
  17. return await this.model.create(body);
  18. }
  19. }
  20. module.exports = Reward_orderService;