From b91923c44f23d3793dfcea0e1f5e097dead7afd9 Mon Sep 17 00:00:00 2001
From: wolter <11@gmail>
Date: Fri, 12 Jun 2026 16:41:26 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E5=95=86=E6=88=B7=E5=8F=AA=E6=9C=891?=
=?UTF-8?q?=E4=B8=AA=E6=94=AF=E4=BB=98=E6=96=B9=E5=BC=8F=E6=97=B6=EF=BC=8C?=
=?UTF-8?q?=E6=94=B6=E9=93=B6=E5=8F=B0=E8=BF=94=E5=9B=9E=E7=9B=96=E6=96=B9?=
=?UTF-8?q?=E5=BC=8F=E4=B8=8D=E6=A0=A1=E9=AA=8C=E7=8E=AF=E5=A2=83=EF=BC=8C?=
=?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=94=A4=E8=B5=B7=E6=94=AF=E4=BB=98=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E5=A2=9E=E5=8A=A0=E6=8C=89=E9=92=AE=E7=82=B9=E5=87=BB?=
=?UTF-8?q?=E5=94=A4=E8=B5=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/http/controllers/front/pay_page.go | 3 ++
app/services/pay_page.go | 7 +++
front/templates/payPage.html | 16 ++++--
front/templates/payTemplateDefault.html | 69 +++++++++++++++++--------
4 files changed, 71 insertions(+), 24 deletions(-)
diff --git a/app/http/controllers/front/pay_page.go b/app/http/controllers/front/pay_page.go
index b61ec89..0e5a8cd 100644
--- a/app/http/controllers/front/pay_page.go
+++ b/app/http/controllers/front/pay_page.go
@@ -12,6 +12,7 @@ import (
"fmt"
"github.com/ahmetb/go-linq/v3"
"github.com/gin-gonic/gin"
+ "github.com/qit-team/snow-core/log/logger"
"net/http"
"strconv"
"strings"
@@ -79,6 +80,8 @@ func PayPage(c *gin.Context) {
func PayChannelList(c *gin.Context) {
req, _ := controllers.GetRequest(c).(*front.PayChannelListRequest)
req.UserAgent = c.Request.UserAgent()
+ logger.Info(c, "PayChannelList", fmt.Sprintf("req.OrderId: %s, req.UserAgent: %s", req.OrderId, req.UserAgent))
+
data, code := services.PayPageChannelList(*req)
result := []front.PayChannelListResponse{}
diff --git a/app/services/pay_page.go b/app/services/pay_page.go
index 0105fff..357c5b6 100644
--- a/app/services/pay_page.go
+++ b/app/services/pay_page.go
@@ -48,6 +48,13 @@ func PayPageChannelList(reqParam front.PayChannelListRequest) (resultPayChannelL
code = errorcode.PayChannelNotFound
return
}
+
+ // 兜底只有1中支付方式,默认返回该支付方式,不校验支付环境
+ if len(payList) == 1 {
+ resultPayChannelList = payList
+ return
+ }
+
merchantPayChannelMap := make(map[int]paychannelmodel.PayChannel, 0)
for _, pay := range payList {
if !pay.ExpireTime.IsZero() && pay.ExpireTime.Unix() < time.Now().Unix() {
diff --git a/front/templates/payPage.html b/front/templates/payPage.html
index 1bde452..3ab9f48 100644
--- a/front/templates/payPage.html
+++ b/front/templates/payPage.html
@@ -265,7 +265,7 @@
- {{else}}
-
- {{end}}
-