From 84688ba4b870637b8a01b05b9de2c04671fac270 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 26 Sep 2023 14:02:05 +0800 Subject: [PATCH] update --- app/customer/md/md_order.go | 21 ++++++++++++++----- .../svc_central_kitchen_for_school_order.go | 13 +++++++++++- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/app/customer/md/md_order.go b/app/customer/md/md_order.go index cc37be9..984a11b 100644 --- a/app/customer/md/md_order.go +++ b/app/customer/md/md_order.go @@ -46,11 +46,22 @@ type CentralKitchenForSchoolMyReserveResp struct { } type CentralKitchenForSchoolMyReserveRespList struct { - Date string `json:"date" label:"日期"` - BreakfastTotal int `json:"breakfast_total" label:"早餐-总计"` - LunchTotal int `json:"lunch_total" label:"午餐-总计"` - DinnerTotal int `json:"dinner_total" label:"晚餐-总计"` - OrdNoList []string `json:"ord_no_list" label:"订单编号列表"` + Date string `json:"date" label:"日期"` + BreakfastTotal int `json:"breakfast_total" label:"早餐-总计"` + LunchTotal int `json:"lunch_total" label:"午餐-总计"` + DinnerTotal int `json:"dinner_total" label:"晚餐-总计"` + BreakfastOrdNoList []struct { + OutTradeNo string `json:"out_trade_no" label:"业务订单号"` + Id int `json:"id" label:"就餐记录id"` + } `json:"breakfast_ord_no_list" label:"早餐-订单列表"` + LunchOrdNoList []struct { + OutTradeNo string `json:"out_trade_no" label:"业务订单号"` + Id int `json:"id" label:"就餐记录id"` + } `json:"lunch_ord_no_list" label:"午餐-订单列表"` + DinnerOrdNoList []struct { + OutTradeNo string `json:"out_trade_no" label:"业务订单号"` + Id int `json:"id" label:"就餐记录id"` + } `json:"dinner_ord_no_list" label:"晚餐-订单列表"` } type SelfSupportForSchoolOrderListReq struct { diff --git a/app/customer/svc/order/svc_central_kitchen_for_school_order.go b/app/customer/svc/order/svc_central_kitchen_for_school_order.go index a5d0f9e..0d392eb 100644 --- a/app/customer/svc/order/svc_central_kitchen_for_school_order.go +++ b/app/customer/svc/order/svc_central_kitchen_for_school_order.go @@ -175,17 +175,28 @@ func CentralKitchenForSchoolMyReserve(userIdentityId int, date, startDate, endDa dateMap[v.Date] = &md.CentralKitchenForSchoolMyReserveRespList{} } dateMap[v.Date].Date = v.Date - dateMap[v.Date].OrdNoList = append(dateMap[v.Date].OrdNoList, v.OrdNo) total++ if v.Kind == enum.CentralKitchenForSchoolUserWithDayKindForBreakfast { + 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 { + 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 { + 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++ }