作者 tangxuhui

Merge branch 'dev' into test

... ... @@ -136,13 +136,13 @@ func GetUserNameByIds(ids []int64) ([]User, error) {
func ExistUserByPhone(phone string) bool {
o := orm.NewOrm()
ok := o.QueryTable(&User{}).Filter("phone", phone).Exist()
ok := o.QueryTable(&User{}).Filter("phone", phone).Filter("delete_at", 0).Exist()
return ok
}
func GetUserByUCenter(ucenterId int64) (v *User, err error) {
v = &User{}
o := orm.NewOrm()
err = o.QueryTable(&User{}).Filter("user_center_id", ucenterId).One(v)
err = o.QueryTable(&User{}).Filter("user_center_id", ucenterId).Filter("delete_at", 0).One(v)
return
}
... ...
... ... @@ -614,7 +614,8 @@ func DeleteEmployeeData(data DeleteUserData) error {
_, err = o.QueryTable(&models.User{}).
Filter("id__in", deleteUserIds).
Update(orm.Params{
"delete_at": time.Now().Format("2006-01-02 15:04:05"),
"delete_at": time.Now().Format("2006-01-02 15:04:05"),
"enable_status": models.USER_ENABLE_NO,
})
if err != nil {
o.Rollback()
... ...