diff --git a/constants/invoice_html.go b/constants/invoice_html.go index ae85bea5..b2eca035 100644 --- a/constants/invoice_html.go +++ b/constants/invoice_html.go @@ -34,7 +34,7 @@ const MAIN_INVOICE_HTML = ` - ' . $sn . ' + {{order_sn}} diff --git a/server/orders/internal/logic/getorderinvoicelogic.go b/server/orders/internal/logic/getorderinvoicelogic.go index cfccc953..aa4336a5 100644 --- a/server/orders/internal/logic/getorderinvoicelogic.go +++ b/server/orders/internal/logic/getorderinvoicelogic.go @@ -172,6 +172,7 @@ func (l *GetOrderInvoiceLogic) GetOrderInvoice(req *types.GetOrderInvoiceReq, us mainHtml = strings.ReplaceAll(mainHtml, "{{first_style1}}", firstStyle1) mainHtml = strings.ReplaceAll(mainHtml, "{{first_style2}}", firstStyle2) mainHtml = strings.ReplaceAll(mainHtml, "{{h5Url}}", constants.H5_URL) + mainHtml = strings.ReplaceAll(mainHtml, "{{order_sn}}", *orderInfo.Sn) mainHtml = strings.ReplaceAll(mainHtml, "{{order_expire_time}}", time.Unix(*orderInfo.Ctime, req.TimeZone*60).Format("02 Jan,2006")) //html内容页面转pdf的base64 prfBase64, err := pdf.HtmlToPdfBase64(mainHtml, 2) diff --git a/utils/qrcode/creator.go b/utils/qrcode/creator.go index 657b2ff2..b89c44d5 100644 --- a/utils/qrcode/creator.go +++ b/utils/qrcode/creator.go @@ -12,7 +12,7 @@ import ( "os" ) -// 带logo的二维码图片生成 content-二维码内容 size-像素单位 outPath 保存路径(传空则不保存) logoPath-logo文件路径(传空就不带) x:x轴整体偏移 y:y轴整体偏移 +// 带logo的二维码图片生成 content-二维码内容 size-像素单位 outPath 保存路径(传空则不保存) disableBorder是否不启用边框 logoPath-logo文件路径(传空就不带) x:x轴整体偏移 y:y轴整体偏移 func CreateQrCodeBs64WithLogo(content, outPath string, logoPath string, size, x, y int, disableBorder bool) (data string, err error) { code, err := qrcode.New(content, qrcode.High) if err != nil {