wangkaiyue 1 жил өмнө
parent
commit
db1b958ba8

+ 1 - 1
internal/service/sendMail.go

@@ -179,7 +179,7 @@ func SendInvoiceSuccessMail(ctx context.Context, callBackId string) error {
 		return err
 	}
 
-	res, err := g.DB().GetOne(ctx, fmt.Sprintf("SELECT invoice_type,mail,taxpayer_identnum,company_name,phone,url,order_code,invoice_variety,invoice_content,invoice_order_code FROM invoice WHERE %s = ? ", queryItem), queryValue)
+	res, err := g.DB().GetOne(ctx, fmt.Sprintf("SELECT invoice_type,mail,taxpayer_identnum,company_name,phone,url,order_code,invoice_variety,invoice_content,invoice_order_code FROM invoice WHERE %s = ? AND invoice_status=1 order by id desc limit 1", queryItem), queryValue)
 	if err != nil {
 		return gerror.Wrapf(err, "未查询到订单发票信息 %s:%s", queryItem, queryValue)
 	}