|
@@ -117,7 +117,8 @@ class MealManage(View):
|
|
|
if page is None or line is None:
|
|
|
return response.json(444)
|
|
|
qs = Store_Meal.objects.values("id", "title", "price", "content", "day", "add_time", "update_time", "currency",
|
|
|
- "type", "bucket_id", "bucket__bucket", "bucket__storeDay")
|
|
|
+ "type", "bucket_id", "bucket__bucket", "commodity_type", "commodity_code",
|
|
|
+ "bucket__storeDay")
|
|
|
res = {}
|
|
|
if qs.exists():
|
|
|
res['count'] = qs.count()
|
|
@@ -132,6 +133,8 @@ class MealManage(View):
|
|
|
content = request_dict.get('content', None)
|
|
|
currency = request_dict.get('currency', None)
|
|
|
bucketID = request_dict.get('bucketID', None)
|
|
|
+ commodity_type = request_dict.get('commodity_type', None)
|
|
|
+ commodity_code = request_dict.get('commodity_code', 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:
|
|
|
return response.json(444, 'id, title, price, content, day,type')
|
|
@@ -145,6 +148,8 @@ class MealManage(View):
|
|
|
store_meal.title = title
|
|
|
store_meal.price = price
|
|
|
store_meal.content = content
|
|
|
+ store_meal.commodity_type = commodity_type
|
|
|
+ store_meal.commodity_code = commodity_code
|
|
|
store_meal.day = day
|
|
|
store_meal.type = type
|
|
|
if bucketID:
|