From c6b1cadc0214c6791a5c5bcc62ab57601e38f457 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期四, 13 八月 2020 11:31:08 +0800
Subject: [PATCH] add db restriction
---
service/carService.go | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/service/carService.go b/service/carService.go
index a3c45e0..3fdff76 100644
--- a/service/carService.go
+++ b/service/carService.go
@@ -309,13 +309,13 @@
hikPersons := sv.GetHikPersonList()
if hikPersons != nil && len(hikPersons) >0 {
var u models.User
- uMap,idMap := u.GetAllMapByPhone()
+ idMap := u.GetAllMap()
hikPM := make(map[string]string)
for _,hp := range hikPersons {
- hikPM[hp.PersonId] = hp.PersonId
- if sp,ok := uMap[hp.PhoneNo];ok {
- if sp.Id != hp.PersonId {
- u.SyncHikPersonId(hp.PhoneNo, hp.PersonId)
+ hikPM[hp.PersonId] = hp.PhoneNo
+ if sp,ok := idMap[hp.PersonId];ok {
+ if sp.PhoneNum != hp.PhoneNo {
+ u.UpdatePhoneNum(hp.PhoneNo, hp.PersonId)
syncCount++
}
}
--
Gitblit v1.8.0