chenjunkai 6 年之前
父节点
当前提交
7f32c4363f
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Controller/MealManage.py

+ 2 - 0
Controller/MealManage.py

@@ -85,6 +85,8 @@ class MealManage(View):
             return response.json(444, 'title,id,price,content,day,bucketID')
         try:
             bucketQs = VodBucketModel.objects.filter(id=bucketID)
+            if Store_Meal.objects.filter(id=id):
+                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.save()
         except Exception: