|
|
@@ -1023,17 +1023,19 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
|
for _, v := range *userIdentities { |
|
|
|
userIdentityIds = append(userIdentityIds, utils.IntToStr(v.Id)) |
|
|
|
} |
|
|
|
userIdentityStr := php2go.Implode(",", userIdentityIds) |
|
|
|
sql2 := fmt.Sprintf("SELECT sum(amount) as total FROM central_kitchen_for_school_user_refund_day where state = %d and identity_id IN (%s) and refund_date >= '%s' and refund_date < '%s'", |
|
|
|
enum.CentralKitchenForSchoolUserRefundDayStateForAuditComplete, userIdentityStr, req.StartDate, req.EndDate) |
|
|
|
mapArr2, err := db.QueryNativeString(db.Db, sql2) |
|
|
|
if err != nil { |
|
|
|
logx.Error(err) |
|
|
|
println("<<<<CentralKitchenForSchoolDataStatisticsExport6>>>>>Error:::", err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
if mapArr2 != nil { |
|
|
|
refund = mapArr2[0]["total"] |
|
|
|
if len(userIdentityIds) != 0 { |
|
|
|
userIdentityStr := php2go.Implode(",", userIdentityIds) |
|
|
|
sql2 := fmt.Sprintf("SELECT sum(amount) as total FROM central_kitchen_for_school_user_refund_day where state = %d and identity_id IN (%s) and refund_date >= '%s' and refund_date < '%s'", |
|
|
|
enum.CentralKitchenForSchoolUserRefundDayStateForAuditComplete, userIdentityStr, req.StartDate, req.EndDate) |
|
|
|
mapArr2, err := db.QueryNativeString(db.Db, sql2) |
|
|
|
if err != nil { |
|
|
|
logx.Error(err) |
|
|
|
println("<<<<CentralKitchenForSchoolDataStatisticsExport6>>>>>Error:::", err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
if mapArr2 != nil { |
|
|
|
refund = mapArr2[0]["total"] |
|
|
|
} |
|
|
|
} |
|
|
|
j := 2 //表头被第一行用了,只能从第二行开始 |
|
|
|
xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.Name, income, refund}) |
|
|
|