|
@@ -278,10 +278,18 @@ func (s *CustomerServ) SaveNewCustomer(wxInfo map[string]interface{}, caseID, ar
|
278
|
278
|
|
279
|
279
|
// 微信相关字段
|
280
|
280
|
nickyName := wxInfo["nickname"].(string)
|
281
|
|
- sex := wxInfo["sex"].(string)
|
282
|
281
|
headimgurl := wxInfo["headimgurl"].(string)
|
283
|
282
|
|
284
|
|
- sexInt, _ := strconv.Atoi(sex)
|
|
283
|
+ var sexInt int
|
|
284
|
+ switch val := wxInfo["sex"].(type) {
|
|
285
|
+ case string:
|
|
286
|
+ sexInt, _ = strconv.Atoi(val)
|
|
287
|
+ case float64:
|
|
288
|
+ sexInt = int(val)
|
|
289
|
+ default:
|
|
290
|
+ sexInt = 1
|
|
291
|
+ }
|
|
292
|
+
|
285
|
293
|
if sexInt == 0 {
|
286
|
294
|
sexInt = 1 // 默认男性
|
287
|
295
|
}
|