Sfoglia il codice sorgente

同步生成用户

xuzhiheng 2 anni fa
parent
commit
d9a2d117db
1 ha cambiato i file con 14 aggiunte e 11 eliminazioni
  1. 14 11
      service/clue.go

+ 14 - 11
service/clue.go

@@ -537,17 +537,7 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
 							}
 						} else {
 							dataMap["uId"] = common.GetRandom(32)
-							JyBiTidb.Insert("dwd_f_userbase_baseinfo", map[string]interface{}{
-								"userid":       v["userId"],
-								"uid":          dataMap["uId"],
-								"name":         name,
-								"phone":        phone,
-								"source":       4,
-								"company_name": companyName,
-								"status":       3,
-								"createtime":   nowTime,
-								"updatetime":   nowTime,
-							})
+							dataMap["isOk"] = "0"
 						}
 					}
 				}
@@ -600,6 +590,19 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
 					clueData := JyBiTidb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"phone": phone}, "", "")
 					if clueData == nil || len(*clueData) == 0 {
 						countAdd++
+						if v["isOk"] != nil {
+							JyBiTidb.Insert("dwd_f_userbase_baseinfo", map[string]interface{}{
+								"userid":       v["userId"],
+								"uid":          v["uId"],
+								"name":         name,
+								"phone":        phone,
+								"source":       4,
+								"company_name": cluename,
+								"status":       3,
+								"createtime":   nowTime,
+								"updatetime":   nowTime,
+							})
+						}
 						clueId := JyBiTidb.Insert("dwd_f_crm_clue_info", map[string]interface{}{
 							"userid":            v["userId"],
 							"uid":               v["uId"],