xuzhiheng 3 年之前
父節點
當前提交
f9f7071b74
共有 1 個文件被更改,包括 25 次插入1 次删除
  1. 25 1
      src/service/private_service.go

+ 25 - 1
src/service/private_service.go

@@ -78,7 +78,6 @@ func (f *Private) Keydatademo(world string) {
 					delete(v, "_id")
 					delete(v, "s_dataid")
 					delete(v, "i_createtime")
-
 					if v["bidamount"] != nil {
 						v["bidamount"] = qu.Float64All(fmt.Sprintf("%f", qu.Float64All(v["bidamount"])))
 					}
@@ -120,6 +119,25 @@ func (f *Private) Keydatademo(world string) {
 							v["company_phone"] = ""
 						}
 					}
+					if v["filehref"] != nil {
+						if filehrefs, ok := v["filehref"].([]map[string]interface{}); ok {
+							urlArr := []string{}
+							for _, href := range filehrefs {
+								url := qu.ObjToString(href["url"])
+								urlArr = append(urlArr, url)
+							}
+							v["filehref"] = strings.Join(urlArr, ",")
+						} else if filehrefs, ok := v["filehref"].([]interface{}); ok {
+							urlArr := []string{}
+							for _, href := range filehrefs {
+								if hrefs, oks := href.(map[string]interface{}); oks {
+									url := qu.ObjToString(hrefs["url"])
+									urlArr = append(urlArr, url)
+								}
+							}
+							v["filehref"] = strings.Join(urlArr, ",")
+						}
+					}
 					deletefields(qu.IntAll((*tagfield)["i_extfieldstype"]), &v)
 					rdata = append(rdata, v)
 				}
@@ -150,6 +168,11 @@ func (f *Private) Keydataoption(world string) {
 	entUserId := qu.IntAll((*datas)["entUserId"])
 	dataConfig, _ := Mgo.FindOne("datatag_export_config", map[string]interface{}{"ent_id": entId})
 	current := GetCurrentCount2(entId, entUserId)
+	userData := JyMysql.FindOne("entniche_user", map[string]interface{}{"id": entUserId}, "phone", "")
+	phone := ""
+	if userData != nil && len(*userData) > 0 {
+		phone = qu.ObjToString((*userData)["phone"])
+	}
 	log.Println("数据余额", current)
 	filterStr := ""
 	isFirst := tmp["isFirst"].(bool)
@@ -180,6 +203,7 @@ func (f *Private) Keydataoption(world string) {
 						v["id"] = infoid
 						v["jybxhref"] = v["s_jyhref"]
 						v["createtime"] = time.Now().Unix()
+						v["phone"] = phone
 						delete(v, "_id")
 						newIdArr = append(newIdArr, infoid)
 					}