12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 'use strict';
- const BaseService = require('./base.js');
- class CashService extends BaseService {
-
- get useModel() {
- const that = this;
- return that.app.model.UsersCashLogs;
- }
-
- async addCashLog(data, transaction) {
- const that = this;
- const orderBean = await that.app.comoBean.instance(data, { transaction });
- await that.service.base.create(orderBean, that.useModel, '提现记录创建失败');
- }
-
- async getCommissionCashingLog() {
- const that = this;
- const seq = that.app.Sequelize;
- const result = await that.useModel.findAll({
- where: { type: { [seq.Op.eq]: 2 }, partner_id: -1 },
- });
- const cashingRes = JSON.parse(JSON.stringify(result));
- return cashingRes;
- }
- async getCoinsCashingLog() {
- const that = this;
- const seq = that.app.Sequelize;
- const result = await that.useModel.findAll({
- where: { type: { [seq.Op.eq]: 2 }, partner_id: { [seq.Op.gt]: 0 } },
- });
- const cashingRes = JSON.parse(JSON.stringify(result));
- return cashingRes;
- }
- }
- module.exports = CashService;
|