Procházet zdrojové kódy

Merge branch 'feature/v3.1.16_ws' of jianyu/salesLeads into feature/v3.1.16

wangshan před 1 rokem
rodič
revize
7674bf8e28
1 změnil soubory, kde provedl 13 přidání a 7 odebrání
  1. 13 7
      src/service/action/info.go

+ 13 - 7
src/service/action/info.go

@@ -667,13 +667,14 @@ func (i *Info) AppNewUerSales() {
 		}
 		body := xweb.FilterXSS(string(i.Body()))
 		log.Println("body:", body)
+		sessVal := i.Session().GetMultiple()
+		userId := qu.InterfaceToStr(sessVal["userId"])
 		//接收参数
 		json.Unmarshal([]byte(body), &infoMap)
 		if len(infoMap) == 0 {
-			return entity.NewResultSales{Error_code: -1, Error_msg: Error_msg_1002}
+			//return entity.NewResultSales{Error_code: -1, Error_msg: Error_msg_1002}
+			//---跳过--- 且没有任何信息
 		}
-		sessVal := i.Session().GetMultiple()
-		userId := qu.InterfaceToStr(sessVal["userId"])
 		var userSales bool
 		for k, v := range infoMap {
 			ik := qu.InterfaceToStr(k)
@@ -777,12 +778,17 @@ func (i *Info) AppNewUerSales() {
 					}
 				}
 			}
+			if len(setMap) > 0 {
+				ok2 := MQFW.UpdateById("user", userId, map[string]interface{}{
+					"$set": setMap,
+				})
+				if !ok2 {
+					return entity.NewResultSales{Error_code: -1, Error_msg: "用户信息保存失败"}
+				}
+			}
 		}
-		ok2 := MQFW.UpdateById("user", userId, map[string]interface{}{
-			"$set": setMap,
-		})
 
-		if !ok && !ok2 {
+		if !ok {
 			return entity.NewResultSales{Error_code: -1, Error_msg: "用户信息保存失败"}
 		}
 		//redis.Put("other", fmt.Sprintf(AppNewUserRegistration, userid), 1, 60*60*24*7)