|
@@ -536,7 +536,7 @@ class serveManagement(View):
|
|
order = request_dict.get('order', None)
|
|
order = request_dict.get('order', None)
|
|
cdk_list = []
|
|
cdk_list = []
|
|
sm_qs = Store_Meal.objects.filter(
|
|
sm_qs = Store_Meal.objects.filter(
|
|
- pay_type__payment='cdk_pay', bucket__mold=mold)
|
|
|
|
|
|
+ pay_type__payment='cdk_pay', bucket__mold=mold, is_show=0)
|
|
if sm_qs.exists:
|
|
if sm_qs.exists:
|
|
rank = sm_qs[0].id
|
|
rank = sm_qs[0].id
|
|
for i in range(int(cdk_num)):
|
|
for i in range(int(cdk_num)):
|
|
@@ -548,6 +548,7 @@ class serveManagement(View):
|
|
create_time=nowTime,
|
|
create_time=nowTime,
|
|
valid_time=0,
|
|
valid_time=0,
|
|
is_activate=0,
|
|
is_activate=0,
|
|
|
|
+ is_down=0,
|
|
rank_id=rank,
|
|
rank_id=rank,
|
|
order=order,
|
|
order=order,
|
|
)
|
|
)
|
|
@@ -577,16 +578,17 @@ class serveManagement(View):
|
|
# 下载国内未使用激活码
|
|
# 下载国内未使用激活码
|
|
content += '激活码(国内)\n'
|
|
content += '激活码(国内)\n'
|
|
cdk_inactivate_qs = CDKcontextModel.objects.filter(
|
|
cdk_inactivate_qs = CDKcontextModel.objects.filter(
|
|
- is_activate=0, rank__bucket__mold=0).values('cdk')
|
|
|
|
|
|
+ is_activate=0, rank__bucket__mold=0, rank__is_show=0).values('cdk')
|
|
else:
|
|
else:
|
|
# 下载国外未使用激活码
|
|
# 下载国外未使用激活码
|
|
content += '激活码(国外)\n'
|
|
content += '激活码(国外)\n'
|
|
cdk_inactivate_qs = CDKcontextModel.objects.filter(
|
|
cdk_inactivate_qs = CDKcontextModel.objects.filter(
|
|
- is_activate=0, rank__bucket__mold=1).values('cdk')
|
|
|
|
|
|
+ is_activate=0, rank__bucket__mold=1, rank__is_show=0).values('cdk')
|
|
for cdk_inactivate in cdk_inactivate_qs:
|
|
for cdk_inactivate in cdk_inactivate_qs:
|
|
content += cdk_inactivate['cdk'] + '\n'
|
|
content += cdk_inactivate['cdk'] + '\n'
|
|
# print(content)
|
|
# print(content)
|
|
|
|
|
|
|
|
+ cdk_inactivate_qs.update(is_down=1)
|
|
response = StreamingHttpResponse(content)
|
|
response = StreamingHttpResponse(content)
|
|
response['Content-Type'] = 'application/octet-stream'
|
|
response['Content-Type'] = 'application/octet-stream'
|
|
response['Content-Disposition'] = 'attachment;filename="CDK.txt"'
|
|
response['Content-Disposition'] = 'attachment;filename="CDK.txt"'
|