huangjiajun pirms 1 gada
vecāks
revīzija
e9aef0d931
2 mainītis faili ar 50 papildinājumiem un 2 dzēšanām
  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 Parādīt failu

@@ -149,10 +149,34 @@ func PDDTurnChain(eg *xorm.Engine, dbName string, args map[string]string) (*md.C
}
miniApp := "0"
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(
thirdZmAppKeyData.Val,
thirdZmAppSecretData.Val,
args["gid"],
masterPid,
pid,
"",
miniApp,
@@ -349,10 +373,34 @@ func ConvertUrl(eg *xorm.Engine, args map[string]string) (*md.ConvertedUrls, err
}
miniApp := "0"
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(
thirdZmAppKeyData.Val,
thirdZmAppSecretData.Val,
args["gid"],
masterPid,
pid,
"",
miniApp,


+ 2
- 2
zhimeng/pdd_convert_url.go Parādīt failu

@@ -7,13 +7,13 @@ import (
"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{}{
"appkey": ak,
"secret_key": sk,
"gid": itemId,
"goods_sign": itemId,
"pid": promoId,
"pid": pid,
"open_app": "", // 具体规则请看智盟
"link_type": "", // todo 这几项按理来说做成配置项
"generate_we_app": isWxMini, // 生成微信小程序链接


Notiek ielāde…
Atcelt
Saglabāt