liuxiaolong
2020-08-12 aa981c60d68d3410d4ea580ca6f24abab43cb30f
models/user.go
@@ -55,17 +55,15 @@
   return all,nil
}
func (u *User) GetAllMapByPhone() (map[string]User, map[string]User) {
   m := make(map[string]User)
func (u *User) GetAllMap() (map[string]User) {
   idM := make(map[string]User)
   all, _ := u.GetAllUsers()
   if all !=nil {
      for _,p := range all {
         m[p.PhoneNum] = p
         idM[p.Id] = p
      }
   }
   return m, idM
   return idM
}
func (u *User) Update() (int64, error) {
@@ -73,9 +71,9 @@
   return o.Update(u)
}
func (u *User) SyncHikPersonId(phoneNum string, hikPersonId string) (int64, error) {
func (u *User) UpdatePhoneNum(phoneNum string, hikPersonId string) (int64, error) {
   o := orm.NewOrm()
   res, err := o.Raw("update sys_user set id=? where phoneNum=?", hikPersonId, phoneNum).Exec()
   res, err := o.Raw("update sys_user set phoneNum=? where id=?", phoneNum, hikPersonId).Exec()
   if err != nil {
      return 0, err
   }