|
@@ -2686,37 +2686,39 @@ func (table *Table) analyBrand() {
|
|
"商品":["",""],
|
|
"商品":["",""],
|
|
"商品_"["",""],
|
|
"商品_"["",""],
|
|
}
|
|
}
|
|
-
|
|
|
|
*/
|
|
*/
|
|
- valArr, f := filterval(realTypeVal...) //过滤数据
|
|
|
|
- if f {
|
|
|
|
|
|
+ valArr, allempty := filterVal(realTypeVal...) //过滤数据
|
|
|
|
+ if allempty {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
realTypeVal = valArr
|
|
realTypeVal = valArr
|
|
line := underline.FindString(key)
|
|
line := underline.FindString(key)
|
|
lineValMap1 := lineMapArr[line]
|
|
lineValMap1 := lineMapArr[line]
|
|
- i := 1
|
|
|
|
- L:
|
|
|
|
- for { //去除数组空数据
|
|
|
|
- last := realTypeVal[len(realTypeVal)-i]
|
|
|
|
- if last == "" {
|
|
|
|
- i++
|
|
|
|
- if i > len(realTypeVal) {
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
- goto L
|
|
|
|
|
|
+ // i := 1
|
|
|
|
+ // L:
|
|
|
|
+ // for { //去除数组空数据
|
|
|
|
+ // last := realTypeVal[len(realTypeVal)-i]
|
|
|
|
+ // if last == "" {
|
|
|
|
+ // i++
|
|
|
|
+ // if i > len(realTypeVal) {
|
|
|
|
+ // break
|
|
|
|
+ // }
|
|
|
|
+ // goto L
|
|
|
|
+ // } else {
|
|
|
|
+ // break
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // dislodgeNull := realTypeVal[:(len(realTypeVal) - i + 1)] //去除数组中空数据
|
|
|
|
+ if len(realTypeVal) > 0 {
|
|
|
|
+ if lineValMap1 == nil {
|
|
|
|
+ tmp := NewSortMap()
|
|
|
|
+ tmp.AddKey(key, realTypeVal)
|
|
|
|
+ lineMapArr[line] = tmp
|
|
} else {
|
|
} else {
|
|
- break
|
|
|
|
|
|
+ lineValMap1.AddKey(key, realTypeVal)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- dislodgeNull := realTypeVal[:(len(realTypeVal) - i + 1)] //去除数组中空数据
|
|
|
|
- if lineValMap1 == nil && len(realTypeVal) != 0 {
|
|
|
|
- tmp := NewSortMap()
|
|
|
|
- tmp.AddKey(key, dislodgeNull)
|
|
|
|
- lineMapArr[line] = tmp
|
|
|
|
- } else {
|
|
|
|
- lineValMap1.AddKey(key, dislodgeNull)
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
//qutil.Debug("lineMapArr---", lineMapArr[line].Keys, lineMapArr[line].Map)
|
|
//qutil.Debug("lineMapArr---", lineMapArr[line].Keys, lineMapArr[line].Map)
|
|
} else if realTypeVal, b := val.(string); b { //val为字符串 {"数量":"1"}
|
|
} else if realTypeVal, b := val.(string); b { //val为字符串 {"数量":"1"}
|
|
/*
|
|
/*
|
|
@@ -2726,19 +2728,19 @@ func (table *Table) analyBrand() {
|
|
"商品__:"",名称__:"",
|
|
"商品__:"",名称__:"",
|
|
}
|
|
}
|
|
*/
|
|
*/
|
|
- valArr, f := filterval(realTypeVal) //过滤数据
|
|
|
|
- if f {
|
|
|
|
|
|
+ valArr, allempty := filterVal(realTypeVal) //过滤数据
|
|
|
|
+ if allempty {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
realTypeVal = valArr[0]
|
|
realTypeVal = valArr[0]
|
|
line := underline.FindString(key)
|
|
line := underline.FindString(key)
|
|
- lineValMap1 := lineMap[line]
|
|
|
|
- if lineValMap1 == nil {
|
|
|
|
|
|
+ lineValMap2 := lineMap[line]
|
|
|
|
+ if lineValMap2 == nil {
|
|
tmp := NewSortMap()
|
|
tmp := NewSortMap()
|
|
tmp.AddKey(key, realTypeVal)
|
|
tmp.AddKey(key, realTypeVal)
|
|
lineMap[line] = tmp
|
|
lineMap[line] = tmp
|
|
} else {
|
|
} else {
|
|
- lineValMap1.AddKey(key, realTypeVal)
|
|
|
|
|
|
+ lineValMap2.AddKey(key, realTypeVal)
|
|
}
|
|
}
|
|
//qutil.Debug("lineMap---", lineMap[line].Keys, lineMap[line].Map)
|
|
//qutil.Debug("lineMap---", lineMap[line].Keys, lineMap[line].Map)
|
|
} else {
|
|
} else {
|
|
@@ -2770,7 +2772,7 @@ func (table *Table) analyBrand() {
|
|
if nameM == "itemname" || nameM == "modal" {
|
|
if nameM == "itemname" || nameM == "modal" {
|
|
hasGoods(table, v0...) //判断itemname和modal中有没有商品
|
|
hasGoods(table, v0...) //判断itemname和modal中有没有商品
|
|
if nameM == "itemname" {
|
|
if nameM == "itemname" {
|
|
- v0tmp1 = filteritem(v0...) //过滤itemname
|
|
|
|
|
|
+ v0tmp1 = filterItem(v0...) //过滤itemname
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if nameM == "brandname" || nameM == "modal" {
|
|
if nameM == "brandname" || nameM == "modal" {
|
|
@@ -2876,7 +2878,7 @@ func (table *Table) analyBrand() {
|
|
if nameM == "itemname" || nameM == "modal" { //特殊处理itemname
|
|
if nameM == "itemname" || nameM == "modal" { //特殊处理itemname
|
|
hasGoods(table, v1)
|
|
hasGoods(table, v1)
|
|
if nameM == "itemname" {
|
|
if nameM == "itemname" {
|
|
- v1tmp1 = filteritem(v1)[0] //过滤itemname
|
|
|
|
|
|
+ v1tmp1 = filterItem(v1)[0] //过滤itemname
|
|
if v1tmp1 == "" {
|
|
if v1tmp1 == "" {
|
|
break
|
|
break
|
|
}
|
|
}
|
|
@@ -3005,11 +3007,9 @@ func assembleData(m interface{}, n int) []map[string]string {
|
|
data[k4] = v4[i]
|
|
data[k4] = v4[i]
|
|
} else {
|
|
} else {
|
|
delete(data, k4)
|
|
delete(data, k4)
|
|
- //continue
|
|
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
fmt.Println("err table")
|
|
fmt.Println("err table")
|
|
- //continue
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
datas[i] = data
|
|
datas[i] = data
|
|
@@ -3101,7 +3101,7 @@ func convert(key, r string) bool {
|
|
reg, err := regexp.Compile(r)
|
|
reg, err := regexp.Compile(r)
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println("reg err:", err)
|
|
fmt.Println("reg err:", err)
|
|
- return flag
|
|
|
|
|
|
+ return false
|
|
}
|
|
}
|
|
flag = reg.MatchString(key)
|
|
flag = reg.MatchString(key)
|
|
return flag
|
|
return flag
|
|
@@ -3136,6 +3136,24 @@ func hasGoods(table *Table, data ...string) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+//func hasBrand(table *Table, data ...string) {
|
|
|
|
+// defer qutil.Catch()
|
|
|
|
+// if table.TableResult.HasBrand == 1 {
|
|
|
|
+// return
|
|
|
|
+// }
|
|
|
|
+// for i, d := range data {
|
|
|
|
+// if d != "" {
|
|
|
|
+// brand := u.BrandGet.CheckSensitiveWord(d)
|
|
|
|
+// qutil.Debug(d, brand)
|
|
|
|
+// if brand != "" {
|
|
|
|
+// table.TableResult.HasBrand = 1
|
|
|
|
+// break
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//}
|
|
|
|
+
|
|
func hasBrand(table *Table, data ...string) ([]string, bool) {
|
|
func hasBrand(table *Table, data ...string) ([]string, bool) {
|
|
defer qutil.Catch()
|
|
defer qutil.Catch()
|
|
//fmt.Println("table.TableResult.HasBrand---------", table.TableResult.HasBrand)
|
|
//fmt.Println("table.TableResult.HasBrand---------", table.TableResult.HasBrand)
|
|
@@ -3161,24 +3179,26 @@ func hasBrand(table *Table, data ...string) ([]string, bool) {
|
|
}
|
|
}
|
|
|
|
|
|
//过滤td值
|
|
//过滤td值
|
|
-func filterval(val ...string) ([]string, bool) {
|
|
|
|
|
|
+func filterVal(val ...string) ([]string, bool) {
|
|
defer qutil.Catch()
|
|
defer qutil.Catch()
|
|
- flag := false
|
|
|
|
|
|
+ n := 0 //记录被过滤的个数
|
|
for i, v := range val {
|
|
for i, v := range val {
|
|
afterFilter := tabletdclear.ReplaceAllString(v, "")
|
|
afterFilter := tabletdclear.ReplaceAllString(v, "")
|
|
afterFilter = NullVal.ReplaceAllString(afterFilter, "")
|
|
afterFilter = NullVal.ReplaceAllString(afterFilter, "")
|
|
if afterFilter == "" {
|
|
if afterFilter == "" {
|
|
- flag = true
|
|
|
|
- } else {
|
|
|
|
- flag = false
|
|
|
|
|
|
+ n++
|
|
}
|
|
}
|
|
val[i] = afterFilter
|
|
val[i] = afterFilter
|
|
}
|
|
}
|
|
- return val, flag
|
|
|
|
|
|
+ allempty := false
|
|
|
|
+ if n == len(val) { //所有都被过滤掉
|
|
|
|
+ allempty = true
|
|
|
|
+ }
|
|
|
|
+ return val, allempty
|
|
}
|
|
}
|
|
|
|
|
|
//过滤itemname全是数字
|
|
//过滤itemname全是数字
|
|
-func filteritem(itemval ...string) []string {
|
|
|
|
|
|
+func filterItem(itemval ...string) []string {
|
|
defer qutil.Catch()
|
|
defer qutil.Catch()
|
|
result := []string{}
|
|
result := []string{}
|
|
for _, v := range itemval {
|
|
for _, v := range itemval {
|
|
@@ -3227,290 +3247,3 @@ func dealNumber(val ...string) ([]string, []string) {
|
|
}
|
|
}
|
|
return result, unitnameArr
|
|
return result, unitnameArr
|
|
}
|
|
}
|
|
-
|
|
|
|
-//func (table *Table) analyBrand() {
|
|
|
|
-// //5c2d8c05a5cb26b9b782572b
|
|
|
|
-// //产品名称 品牌 规格 单价 单位 数量 小计 质保期
|
|
|
|
-// lineMap := make(map[string]map[string]string)
|
|
|
|
-// lineMapArr := make(map[string]map[string][]string)
|
|
|
|
-// brandRule := u.BrandRules
|
|
|
|
-// //将val为数组和string的分开
|
|
|
|
-// //qutil.Debug("table.SortKV.Map====", table.SortKV.Map)
|
|
|
|
-// for key, val := range table.SortKV.Map {
|
|
|
|
-// key = regReplAllSpace.ReplaceAllString(key, "")
|
|
|
|
-// key = strings.Replace(key, "", "", -1) //处理一个特殊的采购量 经上层处理空格后未处理掉
|
|
|
|
-// if realTypeVal, ok := val.([]string); ok { //val为数组 {"数量":["1","2","3"]}
|
|
|
|
-// /*
|
|
|
|
-// {
|
|
|
|
-// "商品":["",""],
|
|
|
|
-// "商品_"["",""],
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// */
|
|
|
|
-// // valArr, f := filterval(realTypeVal...)
|
|
|
|
-// // if f {
|
|
|
|
-// // qutil.Debug("----", key, valArr)
|
|
|
|
-// // continue
|
|
|
|
-// // }
|
|
|
|
-// // realTypeVal = valArr
|
|
|
|
-// //hasGoods1(table, realTypeVal) //判断val中是否含产品
|
|
|
|
-// //hasBrand1(table, realTypeVal) //判断val中是否含品牌
|
|
|
|
-// line := underline.FindString(key)
|
|
|
|
-// lineValMap := lineMapArr[line]
|
|
|
|
-// //qutil.Debug("----", key, line, lineValMap)
|
|
|
|
-// i := 1
|
|
|
|
-// L:
|
|
|
|
-// for { //去除数组空数据
|
|
|
|
-// last := realTypeVal[len(realTypeVal)-i]
|
|
|
|
-// if last == "" {
|
|
|
|
-// i++
|
|
|
|
-// if i > len(realTypeVal) {
|
|
|
|
-// break
|
|
|
|
-// }
|
|
|
|
-// goto L
|
|
|
|
-// } else {
|
|
|
|
-// break
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// dislodgeNull := realTypeVal[:(len(realTypeVal) - i + 1)] //去除数组中空数据
|
|
|
|
-// if len(lineValMap) == 0 && len(realTypeVal) != 0 { //没有数据
|
|
|
|
-// lineMapArr[line] = map[string][]string{key: dislodgeNull}
|
|
|
|
-// } else { //新增数据
|
|
|
|
-// if len(dislodgeNull) != 0 {
|
|
|
|
-// lineValMap[key] = dislodgeNull
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// //qutil.Debug("lineMapArr---", lineMapArr)
|
|
|
|
-// } else if realTypeVal, b := val.(string); b { //val为字符串 {"数量":"1"}
|
|
|
|
-// /*
|
|
|
|
-// {
|
|
|
|
-// "商品:"",名称:"",
|
|
|
|
-// "商品_:"",名称_:"",
|
|
|
|
-// "商品__:"",名称__:"",
|
|
|
|
-// }
|
|
|
|
-// */
|
|
|
|
-// // valArr, f := filterval(realTypeVal)
|
|
|
|
-// // if f {
|
|
|
|
-// // continue
|
|
|
|
-// // }
|
|
|
|
-// // realTypeVal = valArr[0]
|
|
|
|
-// //hasGoods1(table, realTypeVal) //判断val中是否含产品
|
|
|
|
-// //hasBrand1(table, realTypeVal) //判断val中是否含品牌
|
|
|
|
-// line := underline.FindString(key)
|
|
|
|
-// lineValMap := lineMap[line]
|
|
|
|
-// if len(lineValMap) == 0 { //没有数据
|
|
|
|
-// lineMap[line] = map[string]string{key: realTypeVal}
|
|
|
|
-// } else {
|
|
|
|
-// lineValMap[key] = realTypeVal
|
|
|
|
-// }
|
|
|
|
-// } else {
|
|
|
|
-// // "_id" : ObjectId("5c2c3802a5cb26b9b78646c4")
|
|
|
|
-// //成交供应商排名 [map[entname:昆明合优科技有限公司 sortstr:第一中标候选人 sort:1] map[sort:2 entname:昆明厚起科技有限公司 sortstr:第二中标候选人] map[entname:云南远安科技发展有限公司 sortstr:第三中标候选人 sort:3]]
|
|
|
|
-// //fmt.Println("err data:", key, val)
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// //处理数组数据后,匹配必须title和替换要保存的title
|
|
|
|
-// if len(lineMapArr) > 0 {
|
|
|
|
-// for _, aMap := range lineMapArr {
|
|
|
|
-// maxNum := 0
|
|
|
|
-// arrcount1 := 0 //记录key是否存在必须title(数组数据)
|
|
|
|
-// arrcount2 := 0
|
|
|
|
-// ka := make(map[string][]string) //最终存储数据
|
|
|
|
-// //fmt.Println("++++++++++++", aMap)
|
|
|
|
-// for k0, v0 := range aMap {
|
|
|
|
-// //qutil.Debug("k0:", k0, "v0:", v0, len(v0))
|
|
|
|
-// //匹配必须title
|
|
|
|
-// for nameM, r := range brandRule["must"] {
|
|
|
|
-// if convert(k0, r) { //匹配成功
|
|
|
|
-// if len(ka[nameM]) != 0 && strings.Contains(k0, "描述") { //防止k0匹配到多次 和特殊情况 物料名称 物料描述同时出现
|
|
|
|
-// continue
|
|
|
|
-// }
|
|
|
|
-// if nameM == "itemname" || nameM == "modal" {
|
|
|
|
-// if nameM == "itemname" {
|
|
|
|
-// varr, f := filteritem(v0...) //过滤品目
|
|
|
|
-// if f {
|
|
|
|
-// break
|
|
|
|
-// }
|
|
|
|
-// v0 = varr
|
|
|
|
-// }
|
|
|
|
-// hasGoods(table, v0...) //判断itemname和modal中有没有商品
|
|
|
|
-// }
|
|
|
|
-// if nameM == "brandname" || nameM == "modal" {
|
|
|
|
-// //qutil.Debug(nameM, "++++++", len(ka["brandname"]), len(v0))
|
|
|
|
-// if len(ka["brandname"]) == 0 {
|
|
|
|
-// brand, allNull := hasBrand(table, v0...)
|
|
|
|
-// //qutil.Debug(len(brand), "-------", nameM, brand)
|
|
|
|
-// if !allNull {
|
|
|
|
-// ka["brandname"] = brand
|
|
|
|
-// }
|
|
|
|
-// //qutil.Debug("brandname====", len(ka["brandname"]), ka["brandname"])
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// if nameM != "brandname" {
|
|
|
|
-// ka[nameM] = v0
|
|
|
|
-// }
|
|
|
|
-// arrcount1++
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// //替换其它要保存字段
|
|
|
|
-// for nameR, r := range brandRule["replace"] {
|
|
|
|
-// if convert(k0, r) { //匹配成功
|
|
|
|
-// ka[nameR] = v0
|
|
|
|
-// arrcount2++
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// //找最终存储数据的最小len(arr)
|
|
|
|
-// // for _, vf := range ka {
|
|
|
|
-// // //找最短的数组
|
|
|
|
-// // lenVal := len(vf)
|
|
|
|
-// // if minNum == 0 || minNum > lenVal { //maxNum = len(最短数组)
|
|
|
|
-// // minNum = lenVal
|
|
|
|
-// // }
|
|
|
|
-// // }
|
|
|
|
-// //找最终存储数据的最大len(arr),小的补空
|
|
|
|
-// //fmt.Println("ka==============", ka)
|
|
|
|
-// for _, vf1 := range ka {
|
|
|
|
-// lenVal := len(vf1)
|
|
|
|
-// if lenVal > maxNum {
|
|
|
|
-// maxNum = lenVal
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// finishKa := make(map[string][]string)
|
|
|
|
-// for vf2K, vf2 := range ka {
|
|
|
|
-// if len(vf2) < maxNum {
|
|
|
|
-// lenMv := maxNum - len(vf2)
|
|
|
|
-// for i := 0; i < lenMv; i++ {
|
|
|
|
-// vf2 = append(vf2, "")
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// finishKa[vf2K] = vf2
|
|
|
|
-// }
|
|
|
|
-// hasKey(table, arrcount1) //是否匹配到table中的标题
|
|
|
|
-// if arrcount1 >= 1 {
|
|
|
|
-// if arrcount1+arrcount2 == 1 { //删除只匹配到一个价钱(总价)
|
|
|
|
-// delete(finishKa, "unitprice")
|
|
|
|
-// }
|
|
|
|
-// finishData := dealArrData(maxNum, finishKa)
|
|
|
|
-// table.BrandData = append(table.BrandData, finishData)
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// //处理string数据后,匹配必须title和替换要保存的title
|
|
|
|
-// if len(lineMap) > 0 {
|
|
|
|
-// for _, sMap := range lineMap {
|
|
|
|
-// strcount1 := 0 //记录key是否存在必须title(字符串数据)
|
|
|
|
-// strcount2 := 0
|
|
|
|
-// endStrMap := make(map[string]string)
|
|
|
|
-// for k1, v1 := range sMap {
|
|
|
|
-// //qutil.Debug(k1, "++++++++++", v1)
|
|
|
|
-// //匹配必须title
|
|
|
|
-// for nameM, r := range brandRule["must"] {
|
|
|
|
-// if convert(k1, r) { //匹配成功
|
|
|
|
-// if nameM == "itemname" || nameM == "modal" { //特殊处理itemname
|
|
|
|
-// if nameM == "itemname" {
|
|
|
|
-// varr, f := filteritem(v1) //过滤品目
|
|
|
|
-// if f {
|
|
|
|
-// break
|
|
|
|
-// }
|
|
|
|
-// v1 = varr[0]
|
|
|
|
-// }
|
|
|
|
-// hasGoods(table, v1)
|
|
|
|
-// }
|
|
|
|
-// if nameM == "brandname" || nameM == "modal" { //特殊处理brandname
|
|
|
|
-// if len(endStrMap["brandname"]) == 0 {
|
|
|
|
-// brand, allNull := hasBrand(table, v1)
|
|
|
|
-// if !allNull {
|
|
|
|
-// endStrMap["brandname"] = brand[0]
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// if nameM != "brandname" {
|
|
|
|
-// endStrMap[nameM] = v1
|
|
|
|
-// }
|
|
|
|
-// strcount1++
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// //替换其它要保存字段
|
|
|
|
-// for nameR, r := range brandRule["replace"] {
|
|
|
|
-// if convert(k1, r) { //匹配成功
|
|
|
|
-// endStrMap[nameR] = v1
|
|
|
|
-// strcount2++
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// //原始字符串数据处理
|
|
|
|
-// hasKey(table, strcount1) //是否匹配到table中的标题
|
|
|
|
-// if strcount1 >= 1 {
|
|
|
|
-// if strcount1+strcount2 == 1 { //删除只匹配到一个价钱(总价)
|
|
|
|
-// delete(endStrMap, "unitprice")
|
|
|
|
-// }
|
|
|
|
-// finishData := dealStrData(endStrMap) //处理数据
|
|
|
|
-// if len(finishData) > 0 {
|
|
|
|
-// table.BrandData = append(table.BrandData, finishData)
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//}
|
|
|
|
-
|
|
|
|
-////是否有商品
|
|
|
|
-//func hasGoods1(table *Table, data interface{}) {
|
|
|
|
-// if table.TableResult.HasGoods == 1 {
|
|
|
|
-// return
|
|
|
|
-// }
|
|
|
|
-// sData, ok := data.(string)
|
|
|
|
-// proFlag := ""
|
|
|
|
-// if ok { //string数据检查goods
|
|
|
|
-// if sData != "" {
|
|
|
|
-// proFlag = u.GoodsGet.CheckSensitiveWord(sData)
|
|
|
|
-// if len(proFlag) > 0 {
|
|
|
|
-// table.TableResult.HasGoods = 1
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// } else { //arr数据检查goods
|
|
|
|
-// arrData := data.([]string)
|
|
|
|
-// if len(arrData) > 0 {
|
|
|
|
-// for _, src := range arrData {
|
|
|
|
-// if src != "" {
|
|
|
|
-// proFlag = u.GoodsGet.CheckSensitiveWord(src)
|
|
|
|
-// if len(proFlag) > 0 {
|
|
|
|
-// table.TableResult.HasGoods = 1
|
|
|
|
-// break
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//}
|
|
|
|
-
|
|
|
|
-////是否有品牌
|
|
|
|
-//func hasBrand1(table *Table, data interface{}) {
|
|
|
|
-// if table.TableResult.HasBrand == 1 {
|
|
|
|
-// return
|
|
|
|
-// }
|
|
|
|
-// sData, ok := data.(string)
|
|
|
|
-// if ok { //string数据检查brand
|
|
|
|
-// if sData != "" {
|
|
|
|
-// brand := u.BrandGet.CheckSensitiveWord(sData)
|
|
|
|
-// if len(brand) > 0 {
|
|
|
|
-// fmt.Println("brand:", brand, sData)
|
|
|
|
-// table.TableResult.HasBrand = 1
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// } else { //arr数据检查brand
|
|
|
|
-// arrData := data.([]string)
|
|
|
|
-// if len(arrData) > 0 {
|
|
|
|
-// for _, src := range arrData {
|
|
|
|
-// if src != "" {
|
|
|
|
-// brand := u.BrandGet.CheckSensitiveWord(src)
|
|
|
|
-// if len(brand) > 0 {
|
|
|
|
-// table.TableResult.HasBrand = 1
|
|
|
|
-// break
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//}
|
|
|