|
|
@@ -595,6 +595,14 @@ func CheckTaobaoWordGetTkl(eg *xorm.Engine, dbName string, s string, args map[st |
|
|
|
Code: urls.ShortTkl, |
|
|
|
} |
|
|
|
urls.TaoBaoWord = WordDeal(eg, args["master_id"], taokou) |
|
|
|
if urls.TaoBaoWord == "" { |
|
|
|
// 生成淘口令 |
|
|
|
taokou, err := taobaoSdk.WordCreate(urls.ShortenURL, "12345") |
|
|
|
if err != nil { |
|
|
|
taokou = new(md.TaobaoWord) |
|
|
|
} |
|
|
|
urls.TaoBaoWord = WordDeal(eg, args["master_id"], taokou) |
|
|
|
} |
|
|
|
} |
|
|
|
if urls != nil { |
|
|
|
return urls.TaoBaoWord, urls.ItemId, urls.IsDown |
|
|
@@ -902,17 +910,26 @@ func FindTaobaoWord(eg *xorm.Engine, officialEg, zhimengEg *xorm.Engine, tmp map |
|
|
|
goodsParam["acc_vip_self_id"] = userProfile.AccVipShareId |
|
|
|
|
|
|
|
} |
|
|
|
repV := reqCount |
|
|
|
replaceAll := []string{"(", ")", "\\", "/"} |
|
|
|
for _, v2 := range replaceAll { |
|
|
|
repV = strings.ReplaceAll(repV, v2, "") |
|
|
|
} |
|
|
|
//判断如果是有纯字母 字母+数字的内容 并且没有链接的 都调淘宝接口 |
|
|
|
split := regexp.MustCompile("[a-zA-Z0-9]{9,14}").FindAllString(reqCount, -1) |
|
|
|
split := regexp.MustCompile("[a-zA-Z0-9]{9,14}").FindAllString(repV, -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) |
|
|
|
split1 := regexp.MustCompile("[a-zA-Z0-9]{6,15} [a-zA-Z0-9]{6,15}").FindAllString(repV, -1) |
|
|
|
split3 := regexp.MustCompile("[a-zA-Z0-9]{6,15} [a-zA-Z0-9]{4,6}").FindAllString(repV, -1) |
|
|
|
|
|
|
|
if len(split1) > 0 || strings.Contains(reqCount, "tb.cn") { |
|
|
|
if len(split1) > 0 || len(split3) > 0 || strings.Contains(reqCount, "tb.cn") { |
|
|
|
tkl, ItemId, isDown := CheckTaobaoWordGetTkl(eg, dbName, reqCount, goodsParam) |
|
|
|
pvds := md.PVD_TB |
|
|
|
if isDown == "1" { |
|
|
|
pvds = "" |
|
|
|
} |
|
|
|
if isDown == "10" && tkl != "" { |
|
|
|
pvds = "tb_activity" |
|
|
|
} |
|
|
|
return pvds, ItemId, tkl, "" |
|
|
|
} |
|
|
|
//判断是不是有淘宝链接 |
|
|
@@ -923,6 +940,9 @@ func FindTaobaoWord(eg *xorm.Engine, officialEg, zhimengEg *xorm.Engine, tmp map |
|
|
|
if isDown == "1" { |
|
|
|
pvds = "" |
|
|
|
} |
|
|
|
if isDown == "10" && tkl != "" { |
|
|
|
pvds = "tb_activity" |
|
|
|
} |
|
|
|
return pvds, ItemId, tkl, "" |
|
|
|
} |
|
|
|
//split_letter := regexp.MustCompile("[a-zA-Z]{8,15}").FindAllString(reqCount, -1) |
|
|
@@ -941,6 +961,9 @@ func FindTaobaoWord(eg *xorm.Engine, officialEg, zhimengEg *xorm.Engine, tmp map |
|
|
|
if isDown == "1" { |
|
|
|
pvds = "" |
|
|
|
} |
|
|
|
if isDown == "10" && tkl != "" { |
|
|
|
pvds = "tb_activity" |
|
|
|
} |
|
|
|
return pvds, ItemId, tkl, "" |
|
|
|
} |
|
|
|
} |
|
|
@@ -969,6 +992,9 @@ func FindTaobaoWord(eg *xorm.Engine, officialEg, zhimengEg *xorm.Engine, tmp map |
|
|
|
if isDown == "1" { |
|
|
|
pvds = "" |
|
|
|
} |
|
|
|
if isDown == "10" && tkl != "" { |
|
|
|
pvds = "tb_activity" |
|
|
|
} |
|
|
|
return pvds, ItemId, tkl, "" |
|
|
|
} |
|
|
|
if strings.Contains(reqCount, "s.click.Taobao") { |
|
|
@@ -977,6 +1003,9 @@ func FindTaobaoWord(eg *xorm.Engine, officialEg, zhimengEg *xorm.Engine, tmp map |
|
|
|
if isDown == "1" { |
|
|
|
pvds = "" |
|
|
|
} |
|
|
|
if isDown == "10" && tkl != "" { |
|
|
|
pvds = "tb_activity" |
|
|
|
} |
|
|
|
return pvds, ItemId, tkl, "" |
|
|
|
} |
|
|
|
return |
|
|
|