|
@@ -84,9 +84,9 @@ class CDKView(View):
|
|
|
rank = request_dict.get('rank', None)
|
|
|
order = request_dict.get('order', None)
|
|
|
cdk_list = []
|
|
|
- for i in cdk_num:
|
|
|
+ for i in range(int(cdk_num)):
|
|
|
nowTime = int(time.time())
|
|
|
- cdk_model = CDKcontextModel.objects.create(
|
|
|
+ cdk_model = CDKcontextModel(
|
|
|
cdk=uuid.uuid1(),
|
|
|
create_time=nowTime,
|
|
|
valid_time=0,
|
|
@@ -128,7 +128,7 @@ class CDKView(View):
|
|
|
cdk_qs = cdk_qs.filter(order=searchVal)
|
|
|
elif is_activate:
|
|
|
cdk_qs = cdk_qs.filter(is_activate=searchVal)
|
|
|
- cdk_qs = cdk_qs.values('id', 'cdk', 'create_time', 'valid_time', 'is_activate', 'title__rank__id', 'order',
|
|
|
+ cdk_qs = cdk_qs.values('id', 'cdk', 'create_time', 'valid_time', 'is_activate', 'rank__id', 'order',
|
|
|
'create_time')
|
|
|
cdk_qs = cdk_qs.order_by('-create_time') # 根据CDK创建时间降序排序
|
|
|
count = cdk_qs.count()
|
|
@@ -138,7 +138,7 @@ class CDKView(View):
|
|
|
for cdk in cdk_qs:
|
|
|
cdk_dict[cdk['id']] = {'id': cdk['id'], 'cdk': cdk['cdk'], 'create_time': cdk['create_time'],
|
|
|
'valid_time': cdk['valid_time'], 'is_activate': cdk['is_activate'],
|
|
|
- 'rank': cdk['title__rank__id'], 'order': cdk['order']}
|
|
|
+ 'rank': cdk['rank__id'], 'order': cdk['order']}
|
|
|
|
|
|
res = {
|
|
|
'cdk_list': cdk_dict,
|