|
@@ -254,11 +254,10 @@ class UnicomComboView(View):
|
|
updated_time = request_dict.get('updatedTime', None)
|
|
updated_time = request_dict.get('updatedTime', None)
|
|
created_time = request_dict.get('createdTime', None)
|
|
created_time = request_dict.get('createdTime', None)
|
|
is_show = request_dict.get('show', None)
|
|
is_show = request_dict.get('show', None)
|
|
- add = request_dict.get('add', None)
|
|
|
|
|
|
|
|
- if not all([add]):
|
|
|
|
|
|
+ if not all([combo_id]):
|
|
return response.json(444)
|
|
return response.json(444)
|
|
- UnicomCombo.objects.filter(id=combo_id).values()
|
|
|
|
|
|
+ unicom_combo_qs = UnicomCombo.objects.filter(id=combo_id).values()
|
|
|
|
|
|
try:
|
|
try:
|
|
with transaction.atomic():
|
|
with transaction.atomic():
|
|
@@ -276,7 +275,7 @@ class UnicomComboView(View):
|
|
'created_time': created_time,
|
|
'created_time': created_time,
|
|
'is_show': is_show
|
|
'is_show': is_show
|
|
}
|
|
}
|
|
- if add == 1:
|
|
|
|
|
|
+ if unicom_combo_qs.exists():
|
|
UnicomCombo.objects.filter(id=combo_id).update(**re_data)
|
|
UnicomCombo.objects.filter(id=combo_id).update(**re_data)
|
|
UnicomCombo.objects.get(id=combo_id).pay_type.set(pay_type)
|
|
UnicomCombo.objects.get(id=combo_id).pay_type.set(pay_type)
|
|
else:
|
|
else:
|