|
@@ -9,6 +9,8 @@ import ( |
|
|
zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils" |
|
|
zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/zhimeng" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/zhimeng" |
|
|
"fmt" |
|
|
"fmt" |
|
|
|
|
|
"github.com/tidwall/gjson" |
|
|
|
|
|
"strings" |
|
|
"time" |
|
|
"time" |
|
|
"xorm.io/xorm" |
|
|
"xorm.io/xorm" |
|
|
) |
|
|
) |
|
@@ -84,6 +86,63 @@ func ChainTransfer(eg *xorm.Engine, args map[string]string) map[string]string { |
|
|
// 分享 |
|
|
// 分享 |
|
|
if args["provider"] == md.PVD_TIKTOK { |
|
|
if args["provider"] == md.PVD_TIKTOK { |
|
|
args["coupon_url"] = "https://haohuo.jinritemai.com/views/product/item2?id=" + args["gid"] |
|
|
args["coupon_url"] = "https://haohuo.jinritemai.com/views/product/item2?id=" + args["gid"] |
|
|
|
|
|
if strings.Contains(args["gid"], "cid") { |
|
|
|
|
|
ex := strings.Split(args["gid"], "cid") |
|
|
|
|
|
if len(ex) == 2 { |
|
|
|
|
|
args["gid"] = ex[0] |
|
|
|
|
|
args["activityId"] = ex[1] |
|
|
|
|
|
} |
|
|
|
|
|
newTeamToken := "" |
|
|
|
|
|
selectionLibraryTeamKey, _ := db.SysCfgGetOne(eg, "selection_library_team_key") |
|
|
|
|
|
if selectionLibraryTeamKey != nil { |
|
|
|
|
|
newTeamToken = gjson.Get(selectionLibraryTeamKey.Val, "teamAccessToken").String() |
|
|
|
|
|
} |
|
|
|
|
|
appkey := "" |
|
|
|
|
|
secretKey := "" |
|
|
|
|
|
thirdZmAppKeyData, _ := db.SysCfgGetOne(eg, "third_zm_app_key") |
|
|
|
|
|
if thirdZmAppKeyData != nil { |
|
|
|
|
|
appkey = thirdZmAppKeyData.Val |
|
|
|
|
|
} |
|
|
|
|
|
thirdZmAppSecretData, _ := db.SysCfgGetOne(eg, "third_zm_app_secret") |
|
|
|
|
|
if thirdZmAppSecretData != nil { |
|
|
|
|
|
secretKey = thirdZmAppKeyData.Val |
|
|
|
|
|
} |
|
|
|
|
|
tikTokBase, _ := tik_tok.Base(eg, args["master_id"], "") |
|
|
|
|
|
detailUrl := "" |
|
|
|
|
|
if args["activityId"] != "" { |
|
|
|
|
|
postData := map[string]interface{}{} |
|
|
|
|
|
postData["gid"] = args["gid"] |
|
|
|
|
|
postData["appkey"] = appkey |
|
|
|
|
|
postData["secret_key"] = secretKey |
|
|
|
|
|
postData["category_id"] = args["activityId"] |
|
|
|
|
|
postData["p"] = "1" |
|
|
|
|
|
postData["size"] = "1" |
|
|
|
|
|
postData["token"] = newTeamToken |
|
|
|
|
|
list, _ := tik_tok.OwnTeamGoods(tikTokBase, postData) |
|
|
|
|
|
fmt.Println(list) |
|
|
|
|
|
if list != nil { |
|
|
|
|
|
for _, v := range *list { |
|
|
|
|
|
if v.GoodsID == args["gid"] { |
|
|
|
|
|
detailUrl = v.DetailURL |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if detailUrl != "" { |
|
|
|
|
|
postData := map[string]interface{}{ |
|
|
|
|
|
"product_url": detailUrl, |
|
|
|
|
|
"pick_extra": args["master_id"] + "_" + args["uid"], |
|
|
|
|
|
"newTeamToken": newTeamToken, |
|
|
|
|
|
} |
|
|
|
|
|
fmt.Println(postData) |
|
|
|
|
|
detailUrlData, err := tik_tok.OwnTeamUrl(tikTokBase, postData) |
|
|
|
|
|
fmt.Println(detailUrlData) |
|
|
|
|
|
if err == nil && detailUrlData["product_url"] != "" { |
|
|
|
|
|
args["coupon_url"] = detailUrlData["product_url"] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
case md.PVD_VIP: |
|
|
case md.PVD_VIP: |
|
|