diff --git a/api/api_v1/endpoints/query.py b/api/api_v1/endpoints/query.py index be120aa..6a33298 100644 --- a/api/api_v1/endpoints/query.py +++ b/api/api_v1/endpoints/query.py @@ -392,6 +392,8 @@ async def event_model( if item.get('groups'): item['groups'] = np.array(item['groups'])[sort_key].tolist() groups = [] + groupbys=analysis.event_view.get('groupBy') + groupby_list=[i['columnName'] for i in groupbys] for gitem in item['groups']: gb = [] if '(' in gitem or '[' in gitem: @@ -409,8 +411,14 @@ async def event_model( gb.insert(idx, name) # 去掉分组表现里面的'' - appgb = str(gb).replace("'", '') - groups.append(appgb) + # appgb = str(gb).replace("'", '') + # groups.append(appgb) + # item['groups'] = groups + #修改后的方案 + by_dict={} + for i in range(len(gb)): + by_dict[groupby_list[i]]=gb[i] + groups.append(by_dict) item['groups'] = groups else: if group_label: