作者 tangxuhui

Merge branch 'dev' into test

@@ -136,13 +136,13 @@ func GetUserNameByIds(ids []int64) ([]User, error) { @@ -136,13 +136,13 @@ func GetUserNameByIds(ids []int64) ([]User, error) {
136 136
137 func ExistUserByPhone(phone string) bool { 137 func ExistUserByPhone(phone string) bool {
138 o := orm.NewOrm() 138 o := orm.NewOrm()
139 - ok := o.QueryTable(&User{}).Filter("phone", phone).Exist() 139 + ok := o.QueryTable(&User{}).Filter("phone", phone).Filter("delete_at", 0).Exist()
140 return ok 140 return ok
141 } 141 }
142 142
143 func GetUserByUCenter(ucenterId int64) (v *User, err error) { 143 func GetUserByUCenter(ucenterId int64) (v *User, err error) {
144 v = &User{} 144 v = &User{}
145 o := orm.NewOrm() 145 o := orm.NewOrm()
146 - err = o.QueryTable(&User{}).Filter("user_center_id", ucenterId).One(v) 146 + err = o.QueryTable(&User{}).Filter("user_center_id", ucenterId).Filter("delete_at", 0).One(v)
147 return 147 return
148 } 148 }
@@ -615,6 +615,7 @@ func DeleteEmployeeData(data DeleteUserData) error { @@ -615,6 +615,7 @@ func DeleteEmployeeData(data DeleteUserData) error {
615 Filter("id__in", deleteUserIds). 615 Filter("id__in", deleteUserIds).
616 Update(orm.Params{ 616 Update(orm.Params{
617 "delete_at": time.Now().Format("2006-01-02 15:04:05"), 617 "delete_at": time.Now().Format("2006-01-02 15:04:05"),
  618 + "enable_status": models.USER_ENABLE_NO,
618 }) 619 })
619 if err != nil { 620 if err != nil {
620 o.Rollback() 621 o.Rollback()