|
@@ -90,7 +90,6 @@ class MealManage(View):
|
|
|
virtual_price = request_dict.get('virtual_price', None)
|
|
|
is_discounts = request_dict.get('is_discounts', None)
|
|
|
discount_price = request_dict.get('discount_price', None)
|
|
|
- discount_content = request_dict.get('discount_content', None)
|
|
|
expire = request_dict.get('expire', None)
|
|
|
symbol = request_dict.get('symbol', None)
|
|
|
|
|
@@ -106,7 +105,7 @@ class MealManage(View):
|
|
|
return response.json(10, '已存在')
|
|
|
store_meal = Store_Meal(id=id, price=price, day=day, bucket_id=bucketID, commodity_code = commodity_code,
|
|
|
currency=currency, virtual_price=virtual_price, is_discounts=is_discounts,
|
|
|
- discount_price=discount_price, discount_content=discount_content, expire=expire, symbol=symbol)
|
|
|
+ discount_price=discount_price, expire=expire, symbol=symbol)
|
|
|
store_meal.save()
|
|
|
paytype = paytype.split(',')
|
|
|
if len(paytype) > 0:
|
|
@@ -136,7 +135,7 @@ class MealManage(View):
|
|
|
|
|
|
qs = Store_Meal.objects.values("id", "price", "day", "add_time", "update_time", "currency"
|
|
|
, "bucket_id", "commodity_type", "commodity_code", "virtual_price", "is_discounts"
|
|
|
- , "discount_price", "discount_content", "expire", "symbol"
|
|
|
+ , "discount_price", "expire", "symbol"
|
|
|
, "bucket__bucket", "bucket__area", "bucket__storeDay")
|
|
|
res = {}
|
|
|
if qs.exists():
|
|
@@ -167,7 +166,6 @@ class MealManage(View):
|
|
|
virtual_price = request_dict.get('virtual_price', None)
|
|
|
is_discounts = request_dict.get('is_discounts', None)
|
|
|
discount_price = request_dict.get('discount_price', None)
|
|
|
- discount_content = request_dict.get('discount_content', None)
|
|
|
expire = request_dict.get('expire', None)
|
|
|
symbol = request_dict.get('symbol', None)
|
|
|
type = request_dict.get('type', None)
|
|
@@ -188,7 +186,6 @@ class MealManage(View):
|
|
|
store_meal.virtual_price = virtual_price
|
|
|
store_meal.is_discounts = is_discounts
|
|
|
store_meal.discount_price = discount_price
|
|
|
- store_meal.discount_content = discount_content
|
|
|
store_meal.expire = expire
|
|
|
store_meal.symbol = symbol
|
|
|
store_meal.day = day
|
|
@@ -268,16 +265,17 @@ class MealManage(View):
|
|
|
lang = request_dict.get('lang', None)
|
|
|
title = request_dict.get('title', None)
|
|
|
content = request_dict.get('content', None)
|
|
|
- if not store_meal_id or not lang or not title or not content:
|
|
|
+ discount_content = request_dict.get('discount_content', None)
|
|
|
+ if not store_meal_id or not lang or not title or not content or not discount_content:
|
|
|
return response.json(444, 'store_meal_id,lang,title,content')
|
|
|
# 查询该套餐是否存在
|
|
|
storeMeal_qs = Store_Meal.objects.get(id=store_meal_id)
|
|
|
if not storeMeal_qs:
|
|
|
return response.json(500)
|
|
|
- lang_obj = Lang.objects.filter(lang=lang, title=title, content=content)
|
|
|
+ lang_obj = Lang.objects.filter(lang=lang, title=title, content=content, discount_content=discount_content)
|
|
|
if not lang_obj.exists():
|
|
|
# 数据不存在,lang表创建数据
|
|
|
- lang_obj = Lang.objects.create(lang=lang, title=title, content=content)
|
|
|
+ lang_obj = Lang.objects.create(lang=lang, title=title, content=content, discount_content=discount_content)
|
|
|
storeMeal_qs.lang.add(*lang_obj) # store_meal表添加语言数据
|
|
|
# count = lang_obj.count()
|
|
|
# res = {
|