Bläddra i källkod

Merge branch 'develop' of k.zhang/duoduo into master

k.zhang 1 år sedan
förälder
incheckning
5eb58e7406
5 ändrade filer med 51 tillägg och 2 borttagningar
  1. 30 2
      apis/shanghu/client.trans.go
  2. 5 0
      apis/shanghu/models/client.trans.go
  3. 1 0
      go.mod
  4. 2 0
      go.sum
  5. 13 0
      models/shanghu/pay.go

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 30 - 2
apis/shanghu/client.trans.go


+ 5 - 0
apis/shanghu/models/client.trans.go

@@ -24,6 +24,11 @@ type VerificationCodeRequest struct {
 	TransId int64 `json:"trans_id"`
 }
 
+type QRData struct {
+	MerchantId int64  `json:"merchant_id"`
+	Key        string `json:"key"`
+}
+
 type VerificationCodeReply struct {
 	QR string `json:"qr"`
 }

+ 1 - 0
go.mod

@@ -36,6 +36,7 @@ require (
 	github.com/pelletier/go-toml/v2 v2.0.5 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
 	github.com/robfig/cron v1.2.0 // indirect
+	github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect
 	github.com/smartystreets/goconvey v1.7.2 // indirect
 	github.com/ugorji/go/codec v1.2.7 // indirect
 	golang.org/x/crypto v0.14.0 // indirect

+ 2 - 0
go.sum

@@ -159,6 +159,8 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR
 github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
 github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
+github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
 github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs=
 github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
 github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM=

+ 13 - 0
models/shanghu/pay.go

@@ -52,6 +52,19 @@ func (m *ClientPayTrans) GetPayTransByOpenid() (ClientPayTrans, error) {
 	return doc, nil
 }
 
+func (m *ClientPayTrans) GetPayTransById() (ClientPayTrans, error) {
+	var doc ClientPayTrans
+
+	table := orm.ShMysql.Table(m.TableName())
+	table = table.Where("id = ?  ", m.ID)
+
+	if err := table.Select("*").First(&doc).Error; err != nil {
+		return doc, err
+	}
+
+	return doc, nil
+}
+
 func (m *ClientPayTrans) GetPayTransByTradeNo() (ClientPayTrans, error) {
 	var doc ClientPayTrans