|
@@ -1052,26 +1052,21 @@ func MarketingSave(data []map[string]interface{}, email string) {
|
|
entUserId := gconv.Int64((*userMapping)["ent_user_id"])
|
|
entUserId := gconv.Int64((*userMapping)["ent_user_id"])
|
|
CrmService.ExecTx("", func(tx *sql.Tx) bool {
|
|
CrmService.ExecTx("", func(tx *sql.Tx) bool {
|
|
for _, v := range data {
|
|
for _, v := range data {
|
|
- remarkJson := map[string]interface{}{
|
|
|
|
- "提交时间": gconv.String(v["createTime"]),
|
|
|
|
- "销售线索来源": gconv.String(v["source"]),
|
|
|
|
- "具体来源": gconv.String(v["interest"]),
|
|
|
|
- "姓名": common.If(gconv.String(v["username"]) == "", gconv.String(v["phone"]), gconv.String(v["username"])),
|
|
|
|
- "手机号": gconv.String(v["phone"]),
|
|
|
|
- "公司名称": gconv.String(v["company"]),
|
|
|
|
- "数据需求": gconv.String(v["data_requirement"]),
|
|
|
|
- "邮箱": gconv.String(v["email"]),
|
|
|
|
- "公司类型": gconv.String(v["companyType"]),
|
|
|
|
- "职位": gconv.String(v["job"]),
|
|
|
|
- "行业": gconv.String(v["industry"]),
|
|
|
|
|
|
+ remarkFields := []string{
|
|
|
|
+ fmt.Sprintf("%s :%s", "提交时间", gconv.String(v["createTime"])),
|
|
|
|
+ fmt.Sprintf("%s :%s", "销售线索来源", gconv.String(v["source"])),
|
|
|
|
+ fmt.Sprintf("%s :%s", "具体来源", gconv.String(v["interest"])),
|
|
|
|
+ fmt.Sprintf("%s :%s", "姓名", common.If(gconv.String(v["username"]) == "", gconv.String(v["phone"]), gconv.String(v["username"]))),
|
|
|
|
+ fmt.Sprintf("%s :%s", "手机号", gconv.String(v["phone"])),
|
|
|
|
+ fmt.Sprintf("%s :%s", "公司名称", gconv.String(v["company"])),
|
|
|
|
+ fmt.Sprintf("%s :%s", "数据需求", gconv.String(v["data_requirement"])),
|
|
|
|
+ fmt.Sprintf("%s :%s", "邮箱", gconv.String(v["email"])),
|
|
|
|
+ fmt.Sprintf("%s :%s", "公司类型", gconv.String(v["companyType"])),
|
|
|
|
+ fmt.Sprintf("%s :%s", "职位", gconv.String(v["job"])),
|
|
|
|
+ fmt.Sprintf("%s :%s", "行业", gconv.String(v["industry"])),
|
|
}
|
|
}
|
|
|
|
+ filterStr := strings.Join(remarkFields, "\n")
|
|
//线索保存
|
|
//线索保存
|
|
- filter, _ := json.Marshal(remarkJson)
|
|
|
|
- filterStr := gconv.String(filter)
|
|
|
|
- filterStr = strings.ReplaceAll(filterStr, "{", "")
|
|
|
|
- filterStr = strings.ReplaceAll(filterStr, "}", "")
|
|
|
|
- filterStr = strings.ReplaceAll(filterStr, ",", "\n")
|
|
|
|
- filterStr = strings.ReplaceAll(filterStr, `"`, ` `)
|
|
|
|
clueId := CrmService.InsertByTx(tx, "sale_clue", map[string]interface{}{
|
|
clueId := CrmService.InsertByTx(tx, "sale_clue", map[string]interface{}{
|
|
"position_id": positionId,
|
|
"position_id": positionId,
|
|
"ent_id": entId,
|
|
"ent_id": entId,
|