Merge branch 'master' into release

This commit is contained in:
Jay 2018-08-23 23:11:02 +08:00
commit 740eedbb1d

View File

@ -140,4 +140,26 @@ r.put('/channel/:chid/opay/setting', checkSession, getChannelList, hasChannel('c
c.obj = resObject('Success') c.obj = resObject('Success')
}) })
r.get('/channel/:chid/opay/bar', async (c, n) => {
let chid = c.params.chid || ''
if (typeof chid !== 'string' || chid.trim().length === 0) throw genError('DataFormat')
let text = `select ds.* from "public"."donate_setting" ds
left join "public"."twitch_channel" tw
on tw.id = ds.twitch
where
tw.opayid != ''
and tw.id = $1`
let values = [chid]
let result = await c.db.query({
text,
values
})
let setting = {}
if (result.rowCount === 0) setting = {}
setting = result.rows[0]
c.obj = resObject('Success', {setting})
})
module.exports = r module.exports = r