Browse Source

test

master
huangjiajun 1 year ago
parent
commit
e9aef0d931
2 changed files with 50 additions and 2 deletions
  1. +48
    -0
      chain_transfer/svc/svc_turnchain.go
  2. +2
    -2
      zhimeng/pdd_convert_url.go

+ 48
- 0
chain_transfer/svc/svc_turnchain.go View File

@@ -149,10 +149,34 @@ func PDDTurnChain(eg *xorm.Engine, dbName string, args map[string]string) (*md.C
} }
miniApp := "0" miniApp := "0"
isShares := "2" isShares := "2"
masterPid := pid
pddPidData, _ := pdd.NewZhiMengPDDSDK().
SelectFunction("get_pid_list").
WithArgs(map[string]interface{}{
"appkey": db.SysCfgGetWithDb(eg, dbName, md.KEY_CFG_ZM_AK),
"secret_key": db.SysCfgGetWithDb(eg, dbName, md.KEY_CFG_ZM_SK),
"pid": masterPid},
).Result()
if pddPidData != nil {
b, _ := json.Marshal(pddPidData.ToInterface())
pddPid := gjson.GetBytes(b, "pdd_pid").String()
if pddPid == "" {
profile, _ := db.UserProfileFindByID(eg, 0)
if profile != nil {
masterPid = profile.AccPddSelfId
}
}
} else {
profile, _ := db.UserProfileFindByID(eg, 0)
if profile != nil {
masterPid = profile.AccPddSelfId
}
}
urls, err = zhimeng.PDDConvertUrl( urls, err = zhimeng.PDDConvertUrl(
thirdZmAppKeyData.Val, thirdZmAppKeyData.Val,
thirdZmAppSecretData.Val, thirdZmAppSecretData.Val,
args["gid"], args["gid"],
masterPid,
pid, pid,
"", "",
miniApp, miniApp,
@@ -349,10 +373,34 @@ func ConvertUrl(eg *xorm.Engine, args map[string]string) (*md.ConvertedUrls, err
} }
miniApp := "0" miniApp := "0"
isShares := "2" isShares := "2"
masterPid := pid
pddPidData, _ := pdd.NewZhiMengPDDSDK().
SelectFunction("get_pid_list").
WithArgs(map[string]interface{}{
"appkey": db.SysCfgGetWithDb(eg, args["master_id"], md.KEY_CFG_ZM_AK),
"secret_key": db.SysCfgGetWithDb(eg, args["master_id"], md.KEY_CFG_ZM_SK),
"pid": masterPid},
).Result()
if pddPidData != nil {
b, _ := json.Marshal(pddPidData.ToInterface())
pddPid := gjson.GetBytes(b, "pdd_pid").String()
if pddPid == "" {
profile, _ := db.UserProfileFindByID(eg, 0)
if profile != nil {
masterPid = profile.AccPddSelfId
}
}
} else {
profile, _ := db.UserProfileFindByID(eg, 0)
if profile != nil {
masterPid = profile.AccPddSelfId
}
}
urls, err = zhimeng.PDDConvertUrl( urls, err = zhimeng.PDDConvertUrl(
thirdZmAppKeyData.Val, thirdZmAppKeyData.Val,
thirdZmAppSecretData.Val, thirdZmAppSecretData.Val,
args["gid"], args["gid"],
masterPid,
pid, pid,
"", "",
miniApp, miniApp,


+ 2
- 2
zhimeng/pdd_convert_url.go View File

@@ -7,13 +7,13 @@ import (
"fmt" "fmt"
) )


func PDDConvertUrl(ak, sk, itemId, promoId, couponPrice, isWxMini, isBindUrl, isShare string) (*md.ConvertedUrls, error) {
func PDDConvertUrl(ak, sk, itemId, pid, promoId, couponPrice, isWxMini, isBindUrl, isShare string) (*md.ConvertedUrls, error) {
args := map[string]interface{}{ args := map[string]interface{}{
"appkey": ak, "appkey": ak,
"secret_key": sk, "secret_key": sk,
"gid": itemId, "gid": itemId,
"goods_sign": itemId, "goods_sign": itemId,
"pid": promoId,
"pid": pid,
"open_app": "", // 具体规则请看智盟 "open_app": "", // 具体规则请看智盟
"link_type": "", // todo 这几项按理来说做成配置项 "link_type": "", // todo 这几项按理来说做成配置项
"generate_we_app": isWxMini, // 生成微信小程序链接 "generate_we_app": isWxMini, // 生成微信小程序链接


Loading…
Cancel
Save