|
|
@@ -19,9 +19,9 @@ func SyncCentralKitchenForSchoolUserWithDayState(eg *xorm.Engine) { |
|
|
|
|
|
|
|
now := time.Now() |
|
|
|
today := now.Format("2006-01-02") |
|
|
|
breakfastMealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" 06:30", time.Local) |
|
|
|
lunchMealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" 12:00", time.Local) |
|
|
|
dinnerMealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" 17:00", time.Local) |
|
|
|
breakfastMealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" 06:30:00", time.Local) |
|
|
|
lunchMealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" 12:30:00", time.Local) |
|
|
|
dinnerMealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" 17:00:00", time.Local) |
|
|
|
//1、判断当前已过早餐就餐时间 |
|
|
|
if now.After(breakfastMealTime) { |
|
|
|
centralKitchenForSchoolUserWithDay := new(model.CentralKitchenForSchoolUserWithDay) |
|
|
@@ -38,6 +38,7 @@ func SyncCentralKitchenForSchoolUserWithDayState(eg *xorm.Engine) { |
|
|
|
} |
|
|
|
|
|
|
|
//2、判断当前已过午餐就餐时间 |
|
|
|
fmt.Println(lunchMealTime.Format("2006-01-02 15:04:05")) |
|
|
|
if now.After(lunchMealTime) { |
|
|
|
centralKitchenForSchoolUserWithDay := new(model.CentralKitchenForSchoolUserWithDay) |
|
|
|
centralKitchenForSchoolUserWithDay.State = enum.CentralKitchenForSchoolUserWithDayStateForAlready |
|
|
|