|
@@ -79,6 +79,7 @@ class MealManage(View):
|
|
day = request_dict.get('day', None)
|
|
day = request_dict.get('day', None)
|
|
currency = request_dict.get('currency', None)
|
|
currency = request_dict.get('currency', None)
|
|
bucketID = request_dict.get('bucketID', None)
|
|
bucketID = request_dict.get('bucketID', None)
|
|
|
|
+ type = request_dict.get('type', 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)
|
|
@@ -88,8 +89,7 @@ class MealManage(View):
|
|
bucketQs = VodBucketModel.objects.filter(id=bucketID)
|
|
bucketQs = VodBucketModel.objects.filter(id=bucketID)
|
|
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,
|
|
|
|
- currency=currency)
|
|
|
|
|
|
+ store_meal = Store_Meal(id=id, title=title, price=price, content=content, day=day, bucket_id=bucketID,currency=currency,type=type)
|
|
store_meal.save()
|
|
store_meal.save()
|
|
except Exception:
|
|
except Exception:
|
|
errorInfo = traceback.format_exc()
|
|
errorInfo = traceback.format_exc()
|
|
@@ -130,8 +130,9 @@ class MealManage(View):
|
|
content = request_dict.get('content', None)
|
|
content = request_dict.get('content', None)
|
|
currency = request_dict.get('currency', None)
|
|
currency = request_dict.get('currency', None)
|
|
bucketID = request_dict.get('bucketID', None)
|
|
bucketID = request_dict.get('bucketID', None)
|
|
- if not id or not title or not price or not content or not day:
|
|
|
|
- return response.json(444, 'id, title, price, content, day')
|
|
|
|
|
|
+ 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')
|
|
own_perm = ModelService.check_perm(userID=userID, permID=30)
|
|
own_perm = ModelService.check_perm(userID=userID, permID=30)
|
|
if own_perm is not True:
|
|
if own_perm is not True:
|
|
return response.json(404)
|
|
return response.json(404)
|
|
@@ -143,6 +144,7 @@ class MealManage(View):
|
|
store_meal.price = price
|
|
store_meal.price = price
|
|
store_meal.content = content
|
|
store_meal.content = content
|
|
store_meal.day = day
|
|
store_meal.day = day
|
|
|
|
+ store_meal.type = type
|
|
if bucketID:
|
|
if bucketID:
|
|
store_meal.bucket_id = bucketID
|
|
store_meal.bucket_id = bucketID
|
|
if currency:
|
|
if currency:
|