From 06af6e35b62f465f289c6e4b11458f8887f26b46 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 5 Dec 2023 19:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chain_transfer/svc/svc_turnchain.go | 4 ++-- chain_transfer/turn_chain.go | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/chain_transfer/svc/svc_turnchain.go b/chain_transfer/svc/svc_turnchain.go index e487693..aa8651f 100644 --- a/chain_transfer/svc/svc_turnchain.go +++ b/chain_transfer/svc/svc_turnchain.go @@ -511,7 +511,7 @@ func CommGetGoods(eg *xorm.Engine, officialEg *xorm.Engine, tmp map[string]strin } if pvd != md.PVD_TB && pvd != md.PVD_TM && countUrl != "" && tklWord == "" { if urls.ShortenURL == "" { - tcPrase.Count = strings.ReplaceAll(reqCount, countUrl, "["+countUrl+"]") + tcPrase.Count = strings.ReplaceAll(reqCount, countUrl, "") tcPrase.Count = strings.ReplaceAll(tcPrase.Count, "[[", "[") tcPrase.Count = strings.ReplaceAll(tcPrase.Count, "]]", "]") } else { @@ -521,7 +521,7 @@ func CommGetGoods(eg *xorm.Engine, officialEg *xorm.Engine, tmp map[string]strin isNull := "" if pvd != md.PVD_TB && pvd != md.PVD_TM && oldCountUrl != "" && countUrl == "" && tklWord == "" { isNull = "1" - tcPrase.Count = strings.ReplaceAll(reqCount, oldCountUrl, "["+oldCountUrl+"]") + tcPrase.Count = strings.ReplaceAll(reqCount, oldCountUrl, "") tcPrase.Count = strings.ReplaceAll(tcPrase.Count, "[[", "[") tcPrase.Count = strings.ReplaceAll(tcPrase.Count, "]]", "]") } diff --git a/chain_transfer/turn_chain.go b/chain_transfer/turn_chain.go index fa6abed..bde92de 100644 --- a/chain_transfer/turn_chain.go +++ b/chain_transfer/turn_chain.go @@ -242,12 +242,26 @@ func TurnChain(eg *xorm.Engine, officialEg *xorm.Engine, args map[string]string) newV = strings.ReplaceAll(newV, zhios_third_party_utils.IntToStr(i), "") } if strings.Contains(v, "¥") == false && strings.Contains(v, "http") == false { - var numArr = []string{"、", "-", "~", ".", "。", "!", "/", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"} + var numArr = []string{" ", "(", "(", "、", "-", "~", ".", "。", "!", "/", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"} for _, v1 := range numArr { newV = strings.ReplaceAll(newV, v1, "") } } - if goodsId == "" && zhios_third_party_utils.IsAllChinese(newV) == false && (PlatType == "taobao" || PlatType == "") { + split := regexp.MustCompile("[a-zA-Z0-9]{9,14}").FindAllString(v, -1) + //split_letter := regexp.MustCompile("[a-zA-Z]{8,15}").FindAllString(reqCount, -1) + if split != nil && ((zhios_third_party_utils.IsChineseChar(v) && strings.Contains(v, "http")) || strings.Contains(v, "http") == false) { + var is_tkl = 0 + for k1, v1 := range split { + if k1 == 0 { + is_tkl = 1 + tklWord = v1 + } + } + if is_tkl == 1 { + PlatType = "tkl" + } + } + if goodsId == "" && (zhios_third_party_utils.IsAllChinese(newV) == false && (PlatType == "taobao" || PlatType == "") || PlatType == "tkl") { pvd, goodsId, word, _ := svc.FindTaobaoWord(eg, officialEg, args, v, user) if goodsId == "" && pvd == "" {