modify get donate bar api
This commit is contained in:
parent
ade17c8792
commit
9ce747ea8f
@ -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})
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user