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 { ...@@ -111,15 +111,15 @@ class UserService extends Service {
], ],
where: { user_id, day: last_day }, where: { user_id, day: last_day },
}) })
lastday_info.use_amount = lastday_data.amount || 0; lastday_info.use_amount = lastday_data && lastday_data.amount ? Number((lastday_data.amount).toFixed(2)) : 0;
lastday_info.use_money = lastday_data.cost || 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({ const left_money = await ctx.dataModel.YzbillBalance.findOne({
attributes: ['balance_fn'], attributes: ['balance_fn'],
where: { user_id, month: last_month }, 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 detail = []
const bill = await ctx.dataModel.YzbillBalance.findAll({ const bill = await ctx.dataModel.YzbillBalance.findAll({
...@@ -131,10 +131,10 @@ class UserService extends Service { ...@@ -131,10 +131,10 @@ class UserService extends Service {
detail.push({ detail.push({
name: bill[i].company, name: bill[i].company,
date: bill[i].month, date: bill[i].month,
start_left: bill[i].balance_bg, start_left: Number((bill[i].balance_bg).toFixed(2)),
middle_recharge: bill[i].recharge_m, middle_recharge: Number((bill[i].recharge_m).toFixed(2)),
middlefee: bill[i].cost_m, middlefee: Number((bill[i].cost_m).toFixed(2)),
endfee: bill[i].balance_fn, 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