|
@@ -322,7 +322,7 @@ class DeviceDataView(View):
|
|
end_time = request_dict.get('endTime', None)
|
|
end_time = request_dict.get('endTime', None)
|
|
unit_time = request_dict.get('timeUnit', None)
|
|
unit_time = request_dict.get('timeUnit', None)
|
|
if not all([start_time, end_time, unit_time]):
|
|
if not all([start_time, end_time, unit_time]):
|
|
- return response.json(444, {'error param': 'startTime or endTime or timeUnit or order_type'})
|
|
|
|
|
|
+ return response.json(444, {'error param': 'startTime or endTime or timeUnit'})
|
|
s_time = datetime.datetime.fromtimestamp(int(start_time))
|
|
s_time = datetime.datetime.fromtimestamp(int(start_time))
|
|
e_time = datetime.datetime.fromtimestamp(int(end_time))
|
|
e_time = datetime.datetime.fromtimestamp(int(end_time))
|
|
time_list = CommonService.cutting_time(s_time, e_time, unit_time)
|
|
time_list = CommonService.cutting_time(s_time, e_time, unit_time)
|
|
@@ -545,8 +545,8 @@ class DeviceDataView(View):
|
|
})
|
|
})
|
|
for item in continent_list:
|
|
for item in continent_list:
|
|
item['rate'] = round(item['count'] / count_all * 100, 2)
|
|
item['rate'] = round(item['count'] / count_all * 100, 2)
|
|
- res['countries'] = device_country_list
|
|
|
|
- res['continent'] = continent_list
|
|
|
|
|
|
+ res['countries'] = CommonService.list_sort(device_country_list)
|
|
|
|
+ res['continent'] = CommonService.list_sort(continent_list)
|
|
return response.json(0, res)
|
|
return response.json(0, res)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
print(e)
|
|
print(e)
|