const system=require("../../../system");
const ServiceBase=require("../../svems.base")
const settings=require("../../../../config/settings")
class MerchantrechargeService extends ServiceBase{
  constructor(){
     super();
  }

  async add(params) {
    // var res = await this.callms("merchant", "merchantRechargePage", params);
    // await this.transfield(res.data.rows);
    // return res;
  }

  async info(params) {
    var res = await this.callms("merchant", "merchantRechargeInfo", params);
    await this.transfield([res.data]);
    return res;
  }

  async audit(params) {
    var res = await this.callms("merchant", "merchantRechargeAudit", params);
    return res;
  }

  async page(params) {
    var res = await this.callms("merchant", "merchantRechargePage", params);
    await this.transfield(res.data.rows);
    return res;
  }

  async transfield(rows) {
    if (!rows) {
      return;
    }
    for (var item of rows) {
      if (!item) {
        continue;
      }
      item.amt = system.f2y(item.amt);
    }
  }
}
module.exports=MerchantrechargeService;
// var task=new UserService();
// task.getUserStatisticGroupByApp().then(function(result){
//   console.log((result));
// }).catch(function(e){
//   console.log(e);
// });
