|
@@ -76,8 +76,9 @@ func WorkDataHandle(company, phone, demand, name, product string, acceptanceData
|
|
if cluename == "" {
|
|
if cluename == "" {
|
|
cluename = phone //没有线索名,手机号代替
|
|
cluename = phone //没有线索名,手机号代替
|
|
}
|
|
}
|
|
|
|
+
|
|
ok, data, saleData := false, map[string]interface{}{}, []map[string]interface{}{}
|
|
ok, data, saleData := false, map[string]interface{}{}, []map[string]interface{}{}
|
|
- isGroup, isCommerce := GetCompanyType(cluename)
|
|
|
|
|
|
+ isGroup, isCommerce := GetCompanyType(cluename, uId)
|
|
uCount, _ := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, "", ""), true //查当前线索是否已存在
|
|
uCount, _ := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, "", ""), true //查当前线索是否已存在
|
|
if uCount != nil && len(*uCount) > 0 {
|
|
if uCount != nil && len(*uCount) > 0 {
|
|
isUpdate := gconv.Int64((*uCount)["is_artificially_modified"])
|
|
isUpdate := gconv.Int64((*uCount)["is_artificially_modified"])
|
|
@@ -1326,9 +1327,19 @@ func getPositionId(phone string) (positionId int64) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-func GetCompanyType(companyName string) (int, int) {
|
|
|
|
- //是否是集团
|
|
|
|
|
|
+func GetCompanyType(companyName string, uId string) (int, int) {
|
|
isGroup, isCommerce := 0, 0
|
|
isGroup, isCommerce := 0, 0
|
|
|
|
+ uCount := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, "", "")
|
|
|
|
+ if uCount != nil && len(*uCount) > 0 {
|
|
|
|
+ isUpdate := gconv.Int64((*uCount)["is_artificially_modified"])
|
|
|
|
+ if isUpdate == 1 {
|
|
|
|
+ companyName = gconv.String((*uCount)["cluename"])
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if companyName == "" {
|
|
|
|
+ return isGroup, isCommerce
|
|
|
|
+ }
|
|
|
|
+ //是否是集团
|
|
if c := TiDb.CountBySql(`select count(1) from group_company_name where company_name=?`, companyName); c > 0 {
|
|
if c := TiDb.CountBySql(`select count(1) from group_company_name where company_name=?`, companyName); c > 0 {
|
|
isGroup = 1
|
|
isGroup = 1
|
|
}
|
|
}
|