DengBiao преди 1 година
родител
ревизия
ee27e073e3
променени са 1 файла, в които са добавени 31 реда и са изтрити 31 реда
  1. +31
    -31
      app/customer/svc/order/svc_central_kitchen_for_school_order.go

+ 31
- 31
app/customer/svc/order/svc_central_kitchen_for_school_order.go Целия файл

@@ -177,38 +177,38 @@ func CentralKitchenForSchoolMyReserve(userIdentityId int, date, startDate, endDa
var dateMap = map[string]*md.CentralKitchenForSchoolMyReserveRespList{}
var dateMapKey []string
for _, v := range *list {
if v.State == enum.CentralKitchenForSchoolUserWithDayStateForWait || v.State == enum.CentralKitchenForSchoolUserWithDayStateForAlready || v.State == enum.CentralKitchenForSchoolUserWithDayStateForCanceling {
if dateMap[v.Date] == nil {
dateMapKey = append(dateMapKey, v.Date)
dateMap[v.Date] = &md.CentralKitchenForSchoolMyReserveRespList{}
}
dateMap[v.Date].Date = v.Date
total++
if v.Kind == enum.CentralKitchenForSchoolUserWithDayKindForBreakfast && v.State == enum.CentralKitchenForSchoolUserWithDayStateForWait {
dateMap[v.Date].BreakfastOrdNoList = append(dateMap[v.Date].BreakfastOrdNoList, struct {
OutTradeNo string `json:"out_trade_no" label:"业务订单号"`
Id int `json:"id" label:"就餐记录id"`
}{OutTradeNo: v.OrdNo, Id: v.Id})
totalBreakfast++
dateMap[v.Date].BreakfastTotal++
}
if v.Kind == enum.CentralKitchenForSchoolUserWithDayKindForLunch && v.State == enum.CentralKitchenForSchoolUserWithDayStateForWait {
dateMap[v.Date].LunchOrdNoList = append(dateMap[v.Date].BreakfastOrdNoList, struct {
OutTradeNo string `json:"out_trade_no" label:"业务订单号"`
Id int `json:"id" label:"就餐记录id"`
}{OutTradeNo: v.OrdNo, Id: v.Id})
totalLunch++
dateMap[v.Date].LunchTotal++
}
if v.Kind == enum.CentralKitchenForSchoolUserWithDayKindForDinner && v.State == enum.CentralKitchenForSchoolUserWithDayStateForWait {
dateMap[v.Date].DinnerOrdNoList = append(dateMap[v.Date].BreakfastOrdNoList, struct {
OutTradeNo string `json:"out_trade_no" label:"业务订单号"`
Id int `json:"id" label:"就餐记录id"`
}{OutTradeNo: v.OrdNo, Id: v.Id})
dateMap[v.Date].DinnerTotal++
totalDinner++
}
//if v.State == enum.CentralKitchenForSchoolUserWithDayStateForWait || v.State == enum.CentralKitchenForSchoolUserWithDayStateForAlready || v.State == enum.CentralKitchenForSchoolUserWithDayStateForCanceling {
if dateMap[v.Date] == nil {
dateMapKey = append(dateMapKey, v.Date)
dateMap[v.Date] = &md.CentralKitchenForSchoolMyReserveRespList{}
}
dateMap[v.Date].Date = v.Date
total++
if v.Kind == enum.CentralKitchenForSchoolUserWithDayKindForBreakfast && v.State == enum.CentralKitchenForSchoolUserWithDayStateForWait {
dateMap[v.Date].BreakfastOrdNoList = append(dateMap[v.Date].BreakfastOrdNoList, struct {
OutTradeNo string `json:"out_trade_no" label:"业务订单号"`
Id int `json:"id" label:"就餐记录id"`
}{OutTradeNo: v.OrdNo, Id: v.Id})
totalBreakfast++
dateMap[v.Date].BreakfastTotal++
}
if v.Kind == enum.CentralKitchenForSchoolUserWithDayKindForLunch && v.State == enum.CentralKitchenForSchoolUserWithDayStateForWait {
dateMap[v.Date].LunchOrdNoList = append(dateMap[v.Date].BreakfastOrdNoList, struct {
OutTradeNo string `json:"out_trade_no" label:"业务订单号"`
Id int `json:"id" label:"就餐记录id"`
}{OutTradeNo: v.OrdNo, Id: v.Id})
totalLunch++
dateMap[v.Date].LunchTotal++
}
if v.Kind == enum.CentralKitchenForSchoolUserWithDayKindForDinner && v.State == enum.CentralKitchenForSchoolUserWithDayStateForWait {
dateMap[v.Date].DinnerOrdNoList = append(dateMap[v.Date].BreakfastOrdNoList, struct {
OutTradeNo string `json:"out_trade_no" label:"业务订单号"`
Id int `json:"id" label:"就餐记录id"`
}{OutTradeNo: v.OrdNo, Id: v.Id})
dateMap[v.Date].DinnerTotal++
totalDinner++
}
//}
}

for _, value := range dateMapKey {


Зареждане…
Отказ
Запис