|
@@ -84,12 +84,6 @@ class UnicomDataView(View):
|
|
|
user_qs = UnicomDeviceInfo.objects.filter(iccid=item['iccid']).values('user_id')
|
|
|
item['user_id'] = user_qs[0]['user_id'] if user_qs.exists() else ''
|
|
|
iccid_list.append(item)
|
|
|
- res = {
|
|
|
- 'iccidInfo': iccid_list,
|
|
|
- 'totalFlow': round(total_flow, 2),
|
|
|
- 'count': count
|
|
|
- }
|
|
|
- return response.json(0, res)
|
|
|
elif query_type == '2': # 查询联通月度流量信息
|
|
|
iccid_qs = iccid_qs.filter(combo__combo_type__in=[0, 1, 2])
|
|
|
if iccid:
|
|
@@ -120,14 +114,14 @@ class UnicomDataView(View):
|
|
|
iccid_list.append(item)
|
|
|
item['flow_total_usage'] = round(item['flow_total_usage'], 2)
|
|
|
total_flow += float(item['flow_total_usage'])
|
|
|
- res = {
|
|
|
- 'iccidInfo': iccid_list,
|
|
|
- 'totalFlow': round(total_flow, 2),
|
|
|
- 'count': count
|
|
|
- }
|
|
|
- return response.json(0, res)
|
|
|
else:
|
|
|
return response.json(444)
|
|
|
+ res = {
|
|
|
+ 'iccidInfo': iccid_list,
|
|
|
+ 'totalFlow': round(total_flow, 2),
|
|
|
+ 'count': count
|
|
|
+ }
|
|
|
+ return response.json(0, res)
|
|
|
except Exception as e:
|
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|