material_bills_history.js 953 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. 'use strict';
  2. /**
  3. * 工料历史期数据表 数据模型
  4. *
  5. * @author Mai
  6. * @date 2018/8/13
  7. * @version
  8. */
  9. module.exports = app => {
  10. class MaterialBillsHistory extends app.BaseService {
  11. /**
  12. * 构造函数
  13. *
  14. * @param {Object} ctx - egg全局变量
  15. * @return {void}
  16. */
  17. constructor(ctx) {
  18. super(ctx);
  19. this.tableName = 'material_bills_history';
  20. }
  21. /**
  22. * 获取历史本期应耗数量和上期调差金额
  23. * @param mid
  24. * @param order
  25. * @param mb_id
  26. * @returns {Promise<*[]>}
  27. */
  28. async getByMbId(mid, order, mb_id) {
  29. return await this.getDataByCondition({ mid, order, mb_id });
  30. // if (result) {
  31. // return [result.quantity, result.pre_tp];
  32. // }
  33. // return [null, null];
  34. }
  35. }
  36. return MaterialBillsHistory;
  37. };