Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
31b037088f
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go

+ 4
- 0
app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go View File

@@ -1076,15 +1076,19 @@ func SelfSupportForSchoolOrdListExport(c *gin.Context) {
xlsx.SetSheetRow("Sheet1", "A1", &titleList) xlsx.SetSheetRow("Sheet1", "A1", &titleList)
//表头被第一行用了,只能从第二行开始 //表头被第一行用了,只能从第二行开始
j := 2 j := 2
var totalAmount = 0.00
for _, v := range resp { for _, v := range resp {
stateName := "支付成功" stateName := "支付成功"
if v.OrderStatus == 1 { if v.OrderStatus == 1 {
stateName = "待支付" stateName = "待支付"
} }
totalAmount += utils.StrToFloat64(v.TotalPrice)
xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.OutTradeNo, v.TradeNo, v.Phone, v.Name, v.EnterpriseName, v.Class, v.Grade, v.TotalPrice, stateName, v.FaceTime, v.DeviceSn, v.ShopName}) xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.OutTradeNo, v.TradeNo, v.Phone, v.Name, v.EnterpriseName, v.Class, v.Grade, v.TotalPrice, stateName, v.FaceTime, v.DeviceSn, v.ShopName})
j++ j++
} }


xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{"总计:", "-", "-", "-", "-", "-", "-", totalAmount, "-", "-", "-", "-"})

c.Header("Content-Type", "application/octet-stream") c.Header("Content-Type", "application/octet-stream")
c.Header("Content-Disposition", "attachment; filename="+"消费记录"+".xlsx") c.Header("Content-Disposition", "attachment; filename="+"消费记录"+".xlsx")
c.Header("Content-Transfer-Encoding", "binary") c.Header("Content-Transfer-Encoding", "binary")


Loading…
Cancel
Save