Commit 6d0b8de5 authored by 姜登's avatar 姜登

number

parent ed2914f7
Pipeline #21982 passed with stage
in 2 seconds
......@@ -111,15 +111,15 @@ class UserService extends Service {
],
where: { user_id, day: last_day },
})
lastday_info.use_amount = lastday_data.amount || 0;
lastday_info.use_money = lastday_data.cost || 0;
lastday_info.use_amount = lastday_data && lastday_data.amount ? Number((lastday_data.amount).toFixed(2)) : 0;
lastday_info.use_money = lastday_data && lastday_data.cost ? Number((lastday_data.cost).toFixed(2)) : 0;
const left_money = await ctx.dataModel.YzbillBalance.findOne({
attributes: ['balance_fn'],
where: { user_id, month: last_month },
})
lastday_info.left_money = left_money && left_money.balance_fn ? left_money.balance_fn : 0;
lastday_info.left_money = left_money && left_money.balance_fn ? Number((left_money.balance_fn).toFixed(2)) : 0;
const detail = []
const bill = await ctx.dataModel.YzbillBalance.findAll({
......@@ -131,10 +131,10 @@ class UserService extends Service {
detail.push({
name: bill[i].company,
date: bill[i].month,
start_left: bill[i].balance_bg,
middle_recharge: bill[i].recharge_m,
middlefee: bill[i].cost_m,
endfee: bill[i].balance_fn,
start_left: Number((bill[i].balance_bg).toFixed(2)),
middle_recharge: Number((bill[i].recharge_m).toFixed(2)),
middlefee: Number((bill[i].cost_m).toFixed(2)),
endfee: Number((bill[i].balance_fn).toFixed(2)),
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment