26 lines
539 B
Plaintext
Executable File
26 lines
539 B
Plaintext
Executable File
sql = "select * from iptvchannels where del_flg='0'"
|
|
ns = {
|
|
}
|
|
ns = params_kw.copy()
|
|
ns['sort'] = 'tv_name'
|
|
parts = []
|
|
tv_name = params_kw.get('tv_name', None)
|
|
if tv_name:
|
|
tv_name = '%' + tv_name + '%'
|
|
parts.append(' tv_name like ${tv_name}$ ')
|
|
ns['tv_name'] = tv_name
|
|
|
|
if len(parts) > 0:
|
|
sql += ' and ' + 'and'.join(parts)
|
|
|
|
sql += ' order by tv_group, tv_name'
|
|
db=DBPools()
|
|
if not params_kw.get('page'):
|
|
ns['page'] = 1
|
|
ns['rows'] = 100
|
|
|
|
async with db.sqlorContext('iptvdb') as sor:
|
|
recs = await sor.sqlPaging(sql, ns)
|
|
return recs
|
|
|