|
@@ -80,6 +80,7 @@ class MealManage(View):
|
|
currency = request_dict.get('currency', None)
|
|
currency = request_dict.get('currency', None)
|
|
bucketID = request_dict.get('bucketID', None)
|
|
bucketID = request_dict.get('bucketID', None)
|
|
paytype = request_dict.get('paytype', None)
|
|
paytype = request_dict.get('paytype', None)
|
|
|
|
+ virtual_price = request_dict.get('virtual_price', None)
|
|
if not title or not id or not price or not day or not content:
|
|
if not title or not id or not price or not day or not content:
|
|
return response.json(444, 'title,id,price,content,day,bucketID')
|
|
return response.json(444, 'title,id,price,content,day,bucketID')
|
|
own_perm = ModelService.check_perm(userID=userID, permID=40)
|
|
own_perm = ModelService.check_perm(userID=userID, permID=40)
|
|
@@ -90,7 +91,7 @@ class MealManage(View):
|
|
if Store_Meal.objects.filter(id=id):
|
|
if Store_Meal.objects.filter(id=id):
|
|
return response.json(10, '已存在')
|
|
return response.json(10, '已存在')
|
|
store_meal = Store_Meal(id=id, title=title, price=price, content=content, day=day, bucket_id=bucketID,
|
|
store_meal = Store_Meal(id=id, title=title, price=price, content=content, day=day, bucket_id=bucketID,
|
|
- currency=currency)
|
|
|
|
|
|
+ currency=currency, virtual_price=virtual_price)
|
|
store_meal.save()
|
|
store_meal.save()
|
|
paytype = paytype.split(',')
|
|
paytype = paytype.split(',')
|
|
if len(paytype) > 0:
|
|
if len(paytype) > 0:
|
|
@@ -121,7 +122,7 @@ class MealManage(View):
|
|
return response.json(444)
|
|
return response.json(444)
|
|
qs = Store_Meal.objects.values("id", "title", "price", "content", "day", "add_time", "update_time", "currency"
|
|
qs = Store_Meal.objects.values("id", "title", "price", "content", "day", "add_time", "update_time", "currency"
|
|
, "bucket_id", "bucket__bucket", "bucket__area", "commodity_type", "commodity_code",
|
|
, "bucket_id", "bucket__bucket", "bucket__area", "commodity_type", "commodity_code",
|
|
- "bucket__storeDay")
|
|
|
|
|
|
+ "bucket__storeDay", "virtual_price")
|
|
res = {}
|
|
res = {}
|
|
if qs.exists():
|
|
if qs.exists():
|
|
ql = list(qs)
|
|
ql = list(qs)
|
|
@@ -151,6 +152,7 @@ class MealManage(View):
|
|
bucketID = request_dict.get('bucketID', None)
|
|
bucketID = request_dict.get('bucketID', None)
|
|
commodity_type = request_dict.get('commodity_type', None)
|
|
commodity_type = request_dict.get('commodity_type', None)
|
|
commodity_code = request_dict.get('commodity_code', None)
|
|
commodity_code = request_dict.get('commodity_code', None)
|
|
|
|
+ virtual_price = request_dict.get('virtual_price', None)
|
|
type = request_dict.get('type', None)
|
|
type = request_dict.get('type', None)
|
|
if not id or not title or not price or not content or not day or not type:
|
|
if not id or not title or not price or not content or not day or not type:
|
|
return response.json(444, 'id, title, price, content, day,type')
|
|
return response.json(444, 'id, title, price, content, day,type')
|
|
@@ -166,6 +168,7 @@ class MealManage(View):
|
|
store_meal.content = content
|
|
store_meal.content = content
|
|
store_meal.commodity_type = commodity_type
|
|
store_meal.commodity_type = commodity_type
|
|
store_meal.commodity_code = commodity_code
|
|
store_meal.commodity_code = commodity_code
|
|
|
|
+ store_meal.virtual_price = virtual_price
|
|
store_meal.day = day
|
|
store_meal.day = day
|
|
if bucketID:
|
|
if bucketID:
|
|
store_meal.bucket_id = bucketID
|
|
store_meal.bucket_id = bucketID
|