|
|
@@ -166,9 +166,11 @@ func CentralKitchenForSchoolMyReserve(userIdentityId int, date, startDate, endDa |
|
|
|
//2、构造数据 |
|
|
|
var totalBreakfast, totalLunch, totalDinner, total int |
|
|
|
var dateMap = map[string]*md.CentralKitchenForSchoolMyReserveRespList{} |
|
|
|
var dateMapKey []string |
|
|
|
for _, v := range *list { |
|
|
|
if v.State == enum.CentralKitchenForSchoolUserWithDayStateForWait || v.State == enum.CentralKitchenForSchoolUserWithDayStateForAlready { |
|
|
|
if dateMap[v.Date] == nil { |
|
|
|
dateMapKey = append(dateMapKey, v.Date) |
|
|
|
dateMap[v.Date] = &md.CentralKitchenForSchoolMyReserveRespList{} |
|
|
|
} |
|
|
|
dateMap[v.Date].Date = v.Date |
|
|
@@ -187,12 +189,14 @@ func CentralKitchenForSchoolMyReserve(userIdentityId int, date, startDate, endDa |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
for _, value := range dateMapKey { |
|
|
|
resp.List = append(resp.List, *dateMap[value]) |
|
|
|
} |
|
|
|
|
|
|
|
resp.Total = total |
|
|
|
resp.LunchTotal = totalLunch |
|
|
|
resp.DinnerTotal = totalDinner |
|
|
|
resp.BreakfastTotal = totalBreakfast |
|
|
|
for _, v := range dateMap { |
|
|
|
resp.List = append(resp.List, *v) |
|
|
|
} |
|
|
|
return |
|
|
|
} |