Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
1bd5f813f0
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      app/admin/svc/svc_data_statisstics.go

+ 4
- 0
app/admin/svc/svc_data_statisstics.go View File

@@ -828,6 +828,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
Join("LEFT", "class_with_user", "class_with_user.user_identity_id = user_identity.id"). Join("LEFT", "class_with_user", "class_with_user.user_identity_id = user_identity.id").
Join("LEFT", "class", "class_with_user.class_id = class.id"). Join("LEFT", "class", "class_with_user.class_id = class.id").
Join("LEFT", "grade", "class.grade_id = grade.id"). Join("LEFT", "grade", "class.grade_id = grade.id").
Asc("class.id").
FindAndCount(&m) FindAndCount(&m)
if err != nil { if err != nil {
logx.Error(err) logx.Error(err)
@@ -928,6 +929,9 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
var sumBreakfast, sumLunch, sumDinner = int64(0), int64(0), int64(0) var sumBreakfast, sumLunch, sumDinner = int64(0), int64(0), int64(0)
j := 3 //表头前两行用了,只能从第三行开始 j := 3 //表头前两行用了,只能从第三行开始
for k4, v4 := range v3 { for k4, v4 := range v3 {
if v4["breakfast"] == 0 && v4["lunch"] == 0 && v4["dinner"] == 0 {
continue
}
xlsx.SetSheetRow(k3, "A"+strconv.Itoa(j), &[]interface{}{ xlsx.SetSheetRow(k3, "A"+strconv.Itoa(j), &[]interface{}{
k4, v4["breakfast"], v4["lunch"], v4["dinner"]}) k4, v4["breakfast"], v4["lunch"], v4["dinner"]})
sumBreakfast += v4["breakfast"] sumBreakfast += v4["breakfast"]


Loading…
Cancel
Save