|
@@ -99,12 +99,12 @@ class UnicomDataView(View):
|
|
|
if not user_qs.exists():
|
|
|
return response.json(173)
|
|
|
iccid_qs = iccid_qs.filter(iccid=user_qs[0]['iccid'])
|
|
|
- iccid_qs = iccid_qs.values('iccid')[(page - 1) * line:page * line]
|
|
|
+ iccid_qs = iccid_qs.values('iccid').distinct().order_by('iccid')[(page - 1) * line:page * line]
|
|
|
count = iccid_qs.count()
|
|
|
total_flow = 0
|
|
|
for item in iccid_qs:
|
|
|
item['flow_total_usage'] = 0
|
|
|
- key = 'monthly' + item['iccid']
|
|
|
+ key = 'monthly_flow_' + item['iccid']
|
|
|
user_qs = UnicomDeviceInfo.objects.filter(iccid=item['iccid']).values('user_id')
|
|
|
item['user_id'] = user_qs[0]['user_id'] if user_qs.exists() else ''
|
|
|
if year and month:
|
|
@@ -148,7 +148,7 @@ class UnicomDataView(View):
|
|
|
if not iccid:
|
|
|
return response.json(444)
|
|
|
try:
|
|
|
- key = 'monthly' + iccid
|
|
|
+ key = 'monthly_flow_' + iccid
|
|
|
if year and month:
|
|
|
file = year + '-' + month
|
|
|
flow = redis_obj.get_hash_data(key, file)
|