Merge branch 'master' into release

This commit is contained in:
Jay 2018-08-23 23:22:06 +08:00
commit e7a476a8dd
1 changed files with 20 additions and 0 deletions

View File

@ -159,6 +159,26 @@ r.get('/channel/:chid/opay/bar', async (c, n) => {
if (result.rowCount === 0) setting = {}
setting = result.rows[0]
if (result.rowCount > 0) {
text = `select sum(list.price) as total from "public"."opay_donate_list" list
left join "public"."twitch" tw
on tw.opayid = list.opayid
where
tw.opayid != ''
and tw.id = $1
and ctime >= $2
group by list.opayid`
values = [chid, setting.start_date]
let priceResult = await c.db.query({
text, values
})
if (priceResult.rowCount > 0) {
setting.total = priceResult.row[0].price
} else {
setting.total = 0
}
}
c.obj = resObject('Success', {setting})
})