|
@@ -183,15 +183,7 @@ class UnicomComboView(View):
|
|
|
line = int(pageSize)
|
|
|
|
|
|
try:
|
|
|
- combo_order_qs = UnicomComboOrderInfo.objects.filter().values('status',
|
|
|
- 'iccid',
|
|
|
- 'order_id',
|
|
|
- 'flow_total_usage',
|
|
|
- 'next_month_activate',
|
|
|
- 'activation_time',
|
|
|
- 'expire_time',
|
|
|
- 'combo__combo_name')[
|
|
|
- (page - 1) * line:page * line]
|
|
|
+ combo_order_qs = UnicomComboOrderInfo.objects.all()
|
|
|
|
|
|
if serial_no or status:
|
|
|
if serial_no:
|
|
@@ -208,11 +200,17 @@ class UnicomComboView(View):
|
|
|
return response.json(0, [])
|
|
|
unicom_device_qs = UnicomDeviceInfo.objects.filter().values('user_id', 'iccid',
|
|
|
'serial_no')
|
|
|
+
|
|
|
+ combo_order_qs = combo_order_qs.filter().values('status',
|
|
|
+ 'iccid',
|
|
|
+ 'order_id',
|
|
|
+ 'flow_total_usage',
|
|
|
+ 'next_month_activate',
|
|
|
+ 'activation_time',
|
|
|
+ 'expire_time',
|
|
|
+ 'combo__combo_name')[(page - 1) * line:page * line]
|
|
|
+ total = combo_order_qs.count()
|
|
|
data_list = []
|
|
|
- # for unicom_device in unicom_device_qs:
|
|
|
- # userID = unicom_device['user_id']
|
|
|
- # device_user = Device_User.objects.filter(userID=userID).values('NickName')
|
|
|
- # nick_name = device_user[0]['NickName']
|
|
|
for combo_order in combo_order_qs:
|
|
|
data = {'nickName': '',
|
|
|
'iccid': combo_order['iccid'],
|
|
@@ -231,8 +229,7 @@ class UnicomComboView(View):
|
|
|
data['serialNo'] = unicom_device['serial_no']
|
|
|
data['nickName'] = nick_name
|
|
|
data_list.append(data)
|
|
|
- total = combo_order_qs.count()
|
|
|
- return response.json(0, {'list': data_list, 'total': total})
|
|
|
+ return response.json(0, {'list': data_list, 'total': total})
|
|
|
except Exception as e:
|
|
|
print(e)
|
|
|
return response.json(500, repr(e))
|