chenjunkai 6 years ago
parent
commit
d06a96cc91
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Controller/DeviceMeal.py

+ 1 - 1
Controller/DeviceMeal.py

@@ -90,7 +90,7 @@ class DeviceMeal(View):
                     store_meal = Store_Meal.objects.get(id=rank)
                     store_meal = Store_Meal.objects.get(id=rank)
                     dmqs = Device_Meal.objects.filter(uid=uid, channel=channel)
                     dmqs = Device_Meal.objects.filter(uid=uid, channel=channel)
                     if dmqs.exists():
                     if dmqs.exists():
-                        days = dmqs[0].day
+                        days = store_meal.day
                         now_time = timezone.localtime(timezone.now())
                         now_time = timezone.localtime(timezone.now())
                         if now_time > dmqs[0].end_time:
                         if now_time > dmqs[0].end_time:
                             end_time = now_time + datetime.timedelta(days=int(days))
                             end_time = now_time + datetime.timedelta(days=int(days))