Browse Source

add Reverse: for v0.2.0

tags/v0.2.0
DengBiao 2 years ago
parent
commit
7e8fc783e8
1 changed files with 5 additions and 6 deletions
  1. +5
    -6
      pay/pay.go

+ 5
- 6
pay/pay.go View File

@@ -6,18 +6,17 @@ import (
"errors" "errors"
) )


func JudgePayChannel(mid, paySceneIdentifier string) (model.PayChannel, error) {
func JudgePayChannel(mid, paySceneIdentifier string) (model.PayChannelMaster, error) {
var payChannelMaster = model.PayChannelMaster{} var payChannelMaster = model.PayChannelMaster{}
var payChannel = model.PayChannel{}
res, err := db.Db.Where("app_id = ?", mid).And("identifier = ?", paySceneIdentifier).Get(&payChannelMaster) res, err := db.Db.Where("app_id = ?", mid).And("identifier = ?", paySceneIdentifier).Get(&payChannelMaster)
if err != nil { if err != nil {
return payChannel, err
return payChannelMaster, err
} }
if !res { if !res {
return payChannel, errors.New("查询数据失败")
return payChannelMaster, errors.New("查询数据失败")
} }
if payChannelMaster.ChannelId == 0 { if payChannelMaster.ChannelId == 0 {
return payChannel, errors.New("请联系服务商绑定支付渠道")
return payChannelMaster, errors.New("请联系服务商绑定支付渠道")
} }
return payChannel, nil
return payChannelMaster, nil
} }

Loading…
Cancel
Save