|
@@ -485,6 +485,21 @@ func TikTokUrl(eg *xorm.Engine, dbName string, gid, activityId string) string { |
|
|
} |
|
|
} |
|
|
return url |
|
|
return url |
|
|
} |
|
|
} |
|
|
|
|
|
func CheckTaobaoWordGetTkl(eg *xorm.Engine, dbName string, s string, args map[string]string) (string, string) { |
|
|
|
|
|
taobaoSdk, _ := taobao.NewTaobaoSDK(eg, dbName, args["platfrom"], zhios_third_party_utils.StrToInt(args["acc_taobao_share_id"]), args["union_id"]) |
|
|
|
|
|
if taobaoSdk == nil { |
|
|
|
|
|
return "", "" |
|
|
|
|
|
} |
|
|
|
|
|
urls, _ := taobaoSdk.WnConvertUrlSC(s, "2", taobaoSdk.SelfPromoIdWeb, args["acc_taobao_share_id"]) |
|
|
|
|
|
if urls == nil { |
|
|
|
|
|
return "", "" |
|
|
|
|
|
} |
|
|
|
|
|
// 查无数据 |
|
|
|
|
|
if urls.TaoBaoWord == "" { |
|
|
|
|
|
return "", "" |
|
|
|
|
|
} |
|
|
|
|
|
return urls.TaoBaoWord, urls.ItemId |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 淘口令 |
|
|
// 淘口令 |
|
|
func CheckTaobaoWordGetId(eg *xorm.Engine, dbName string, s string, args map[string]string) string { |
|
|
func CheckTaobaoWordGetId(eg *xorm.Engine, dbName string, s string, args map[string]string) string { |
|
@@ -511,7 +526,7 @@ func CommGetGoods(eg *xorm.Engine, officialEg *xorm.Engine, tmp map[string]strin |
|
|
oldCountUrl := countUrl |
|
|
oldCountUrl := countUrl |
|
|
var urls = &md.ConvertedUrls{} |
|
|
var urls = &md.ConvertedUrls{} |
|
|
var err error |
|
|
var err error |
|
|
if tklWord != "" && zhios_third_party_utils.InArr(pvd, []string{md.PVD_TIKTOKLIFE, md.PVD_TIKTOK, md.PVD_KUAISHOU}) { |
|
|
|
|
|
|
|
|
if tklWord != "" && zhios_third_party_utils.InArr(pvd, []string{md.PVD_TIKTOKLIFE, md.PVD_TIKTOK, md.PVD_KUAISHOU, md.PVD_TM, md.PVD_TB}) { |
|
|
urls.TaoBaoWord = tklWord |
|
|
urls.TaoBaoWord = tklWord |
|
|
} else if tklWord != "" && zhios_third_party_utils.InArr(newPvd, []string{md.PVD_TIKTOKLIFE, md.PVD_TIKTOK}) { |
|
|
} else if tklWord != "" && zhios_third_party_utils.InArr(newPvd, []string{md.PVD_TIKTOKLIFE, md.PVD_TIKTOK}) { |
|
|
urls.TaoBaoWord = tklWord |
|
|
urls.TaoBaoWord = tklWord |
|
@@ -575,13 +590,13 @@ func CommGetGoods(eg *xorm.Engine, officialEg *xorm.Engine, tmp map[string]strin |
|
|
tcPrase.Count = strings.ReplaceAll(tcPrase.Count, "]]", "]") |
|
|
tcPrase.Count = strings.ReplaceAll(tcPrase.Count, "]]", "]") |
|
|
} |
|
|
} |
|
|
fmt.Println(isNull) |
|
|
fmt.Println(isNull) |
|
|
if (pvd == md.PVD_TIKTOKLIFE || pvd == md.PVD_TIKTOK || newPvd == md.PVD_TIKTOK) && tklWord != "" { |
|
|
|
|
|
|
|
|
if (pvd == md.PVD_TIKTOKLIFE || pvd == md.PVD_TIKTOK || newPvd == md.PVD_TIKTOK || pvd == md.PVD_TB || pvd == md.PVD_TM) && tklWord != "" { |
|
|
tcPrase.Count = strings.ReplaceAll(reqCount, countUrl, tklWord) |
|
|
tcPrase.Count = strings.ReplaceAll(reqCount, countUrl, tklWord) |
|
|
} |
|
|
} |
|
|
if pvd == md.PVD_KUAISHOU && tklWord != "" { |
|
|
if pvd == md.PVD_KUAISHOU && tklWord != "" { |
|
|
tcPrase.Count = strings.ReplaceAll(reqCount, countUrl, tklWord) |
|
|
tcPrase.Count = strings.ReplaceAll(reqCount, countUrl, tklWord) |
|
|
} |
|
|
} |
|
|
if pvd == md.PVD_TB || pvd == md.PVD_TM { |
|
|
|
|
|
|
|
|
if (pvd == md.PVD_TB || pvd == md.PVD_TM) && tklWord == "" { |
|
|
word, _ := ReplaceTbAll(eg, urls.ShortenURL, tmp) |
|
|
word, _ := ReplaceTbAll(eg, urls.ShortenURL, tmp) |
|
|
tcPrase.Tkl = word |
|
|
tcPrase.Tkl = word |
|
|
if countUrl != "" && strings.Contains(countUrl, "http") { |
|
|
if countUrl != "" && strings.Contains(countUrl, "http") { |
|
@@ -766,6 +781,17 @@ func FindTaobaoWord(eg *xorm.Engine, officialEg *xorm.Engine, tmp map[string]str |
|
|
goodsParam["acc_jd_share_id"] = userProfile.AccJdCloudId |
|
|
goodsParam["acc_jd_share_id"] = userProfile.AccJdCloudId |
|
|
goodsParam["acc_pdd_self_id"] = userProfile.AccPddSelfId |
|
|
goodsParam["acc_pdd_self_id"] = userProfile.AccPddSelfId |
|
|
} |
|
|
} |
|
|
|
|
|
//判断如果是有纯字母 字母+数字的内容 并且没有链接的 都调淘宝接口 |
|
|
|
|
|
split := regexp.MustCompile("[a-zA-Z0-9]{9,14}").FindAllString(reqCount, -1) |
|
|
|
|
|
//split_letter := regexp.MustCompile("[a-zA-Z]{8,15}").FindAllString(reqCount, -1) |
|
|
|
|
|
split1 := regexp.MustCompile("[a-zA-Z0-9]{6,15} [a-zA-Z0-9]{6,15}").FindAllString(reqCount, -1) |
|
|
|
|
|
|
|
|
|
|
|
if len(split1) > 0 || strings.Contains(reqCount, "tb.cn") { |
|
|
|
|
|
tkl, ItemId := CheckTaobaoWordGetTkl(eg, dbName, reqCount, goodsParam) |
|
|
|
|
|
if tkl != "" { |
|
|
|
|
|
return md.PVD_TB, ItemId, tkl, "" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
//判断是不是有淘宝链接 |
|
|
//判断是不是有淘宝链接 |
|
|
if strings.Count(reqCount, "€") >= 1 || strings.Contains(reqCount, "tb.cn") { |
|
|
if strings.Count(reqCount, "€") >= 1 || strings.Contains(reqCount, "tb.cn") { |
|
|
|
|
|
|
|
@@ -775,8 +801,6 @@ func FindTaobaoWord(eg *xorm.Engine, officialEg *xorm.Engine, tmp map[string]str |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
//判断如果是有纯字母 字母+数字的内容 并且没有链接的 都调淘宝接口 |
|
|
|
|
|
split := regexp.MustCompile("[a-zA-Z0-9]{9,14}").FindAllString(reqCount, -1) |
|
|
|
|
|
//split_letter := regexp.MustCompile("[a-zA-Z]{8,15}").FindAllString(reqCount, -1) |
|
|
//split_letter := regexp.MustCompile("[a-zA-Z]{8,15}").FindAllString(reqCount, -1) |
|
|
if split != nil && ((zhios_third_party_utils.IsChineseChar(reqCount) && strings.Contains(reqCount, "http")) || strings.Contains(reqCount, "http") == false) { |
|
|
if split != nil && ((zhios_third_party_utils.IsChineseChar(reqCount) && strings.Contains(reqCount, "http")) || strings.Contains(reqCount, "http") == false) { |
|
|
var is_tkl = 0 |
|
|
var is_tkl = 0 |
|
|