|
@@ -485,10 +485,16 @@ class serveManagement(View):
|
|
|
**store_meal_data)
|
|
|
Store_Meal.objects.get(id=storeMealID).pay_type.set(pay_type)
|
|
|
# 更新苹果内购套餐
|
|
|
- InAppPurchasePackage.objects.filter(rank__id=storeMealID).\
|
|
|
- update(
|
|
|
- product_id=product_id, subscription_group=subscription_group,
|
|
|
- subscription_group_id=subscription_group_id, package_type=package_type)
|
|
|
+ in_app_purchase_qs = InAppPurchasePackage.objects.filter(rank__id=storeMealID)
|
|
|
+ if in_app_purchase_qs.exists():
|
|
|
+ in_app_purchase_qs.update(
|
|
|
+ product_id=product_id, subscription_group=subscription_group,
|
|
|
+ subscription_group_id=subscription_group_id, package_type=package_type)
|
|
|
+ else:
|
|
|
+ if any([product_id, subscription_group, subscription_group_id, package_type]):
|
|
|
+ InAppPurchasePackage.objects.create(
|
|
|
+ rank_id=storeMealID, subscription_group=subscription_group,
|
|
|
+ subscription_group_id=subscription_group_id, package_type=package_type)
|
|
|
else:
|
|
|
store_meal = Store_Meal.objects.create(**store_meal_data).pay_type.set(pay_type)
|
|
|
# 新增苹果内购套餐
|