瀏覽代碼

update

add_mode
DengBiao 1 年之前
父節點
當前提交
9cca454ef3
共有 1 個文件被更改,包括 28 次插入21 次删除
  1. +28
    -21
      app/admin/svc/svc_data_statisstics.go

+ 28
- 21
app/admin/svc/svc_data_statisstics.go 查看文件

@@ -1574,29 +1574,36 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
return
}

count1, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
}
count2, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForLunch, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
}
count3, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForDinner, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
for _, value := range req.MealKindList {
if value == enum.CentralKitchenForSchoolUserWithDayKindForBreakfast {
count1, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
}
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForBreakfast).String()] += count1
}
if value == enum.CentralKitchenForSchoolUserWithDayKindForLunch {
count2, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForLunch, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
}
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForLunch).String()] += count2
}
if value == enum.CentralKitchenForSchoolUserWithDayKindForDinner {
count3, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayKindForDinner, enum.CentralKitchenForSchoolUserWithDayStateForCancel)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
return
}
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForDinner).String()] += count3
}
}

list[v.Enterprise.Name]["count"] += count
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForBreakfast).String()] += count1
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForLunch).String()] += count2
list[v.Enterprise.Name][enum.CentralKitchenForSchoolUserWithDayKind(enum.CentralKitchenForSchoolUserWithDayKindForDinner).String()] += count3
time.Sleep(20 * time.Millisecond) // 20毫秒
}



Loading…
取消
儲存