方法字段接口添加是否需要排序字段(默认为0)

This commit is contained in:
pengtao 2019-08-15 16:39:46 +08:00
parent cb4ef6c73f
commit 6e76875505
2 changed files with 5 additions and 3 deletions

View File

@ -83,7 +83,7 @@ http://154.8.214.202:5022/webapp/index.php?c=Ops&a=getreport&gameid=2001&channel
| gameid | string | 是 | 查询的游戏ID | | gameid | string | 是 | 查询的游戏ID |
| channelid | string | 否 | 查询的平台ID默认为6001 | | channelid | string | 否 | 查询的平台ID默认为6001 |
| methods | string | 是 | 默认为6001微信 | | methods | string | 是 | 默认为6001微信 |
| date | datetime | 是 | 查询的报表数据格式为“2019-08-12” | | times | string | 是 | 查询的报表数据格式为“2019-08-12” |
##### 返回参数说明 ##### 返回参数说明

View File

@ -48,12 +48,14 @@ class DispatchHandler(tornado.web.RequestHandler):
sql = f"""SELECT sql = f"""SELECT
a.method_name, a.method_name,
a.method_display, a.method_display,
a.need_sort,
b.fields, b.fields,
b.comment b.comment
FROM FROM
(SELECT (SELECT
method_name, method_name,
method_display method_display,
need_sort
FROM FROM
methods methods
WHERE WHERE
@ -74,7 +76,7 @@ class DispatchHandler(tornado.web.RequestHandler):
for line in data: for line in data:
temp = {} temp = {}
try: try:
temp['methods'], temp['method_display'],temp['fields'], temp['comment'] = line temp['methods'], temp['method_display'],temp['need_sort'],temp['fields'], temp['comment'] = line
output.append(temp) output.append(temp)
except Exception: except Exception:
log.error(f"split {line} error, get data from methods!", exc_info=True) log.error(f"split {line} error, get data from methods!", exc_info=True)