Merge branch 'master' into release
This commit is contained in:
commit
740eedbb1d
@ -140,4 +140,26 @@ r.put('/channel/:chid/opay/setting', checkSession, getChannelList, hasChannel('c
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user