@@ -22,6 +22,7 @@ type UserDao struct {
2222 Email string `gorm:"email"`
2323 LoginAccount string `gorm:"login_account"`
2424 LoginPass string `gorm:"login_pass"`
25+ Status int `gorm:"status"`
2526 CreatedTime time.Time `gorm:"created_time"`
2627 UpdatedTime time.Time `gorm:"updated_time"`
2728 AppKey string `gorm:"app_key"`
@@ -51,6 +52,7 @@ func (user UserDao) FindByUserId(appkey, userId string) (*models.User, error) {
5152 Email : item .Email ,
5253 LoginAccount : item .LoginAccount ,
5354 LoginPass : item .LoginPass ,
55+ Status : item .Status ,
5456 CreatedTime : item .CreatedTime ,
5557 UpdatedTime : item .UpdatedTime ,
5658 AppKey : item .AppKey ,
@@ -71,6 +73,7 @@ func (user UserDao) FindByUserIds(appkey string, userIds []string) (map[string]*
7173 UserType : item .UserType ,
7274 Phone : item .Phone ,
7375 Email : item .Email ,
76+ Status : item .Status ,
7477 CreatedTime : item .CreatedTime ,
7578 UpdatedTime : item .UpdatedTime ,
7679 AppKey : item .AppKey ,
@@ -98,6 +101,7 @@ func (user UserDao) SearchByKeyword(appkey string, userId, keyword string) ([]*m
98101 Phone : item .Phone ,
99102 Email : item .Email ,
100103 LoginAccount : item .LoginAccount ,
104+ Status : item .Status ,
101105 CreatedTime : item .CreatedTime ,
102106 UpdatedTime : item .UpdatedTime ,
103107 AppKey : item .AppKey ,
@@ -126,6 +130,7 @@ func (user UserDao) FindByPhone(appkey, phone string) (*models.User, error) {
126130 Email : item .Email ,
127131 LoginAccount : item .LoginAccount ,
128132 LoginPass : item .LoginPass ,
133+ Status : item .Status ,
129134 CreatedTime : item .CreatedTime ,
130135 UpdatedTime : item .UpdatedTime ,
131136 AppKey : item .AppKey ,
@@ -152,6 +157,7 @@ func (user UserDao) FindByEmail(appkey, email string) (*models.User, error) {
152157 Email : item .Email ,
153158 LoginAccount : item .LoginAccount ,
154159 LoginPass : item .LoginPass ,
160+ Status : item .Status ,
155161 CreatedTime : item .CreatedTime ,
156162 UpdatedTime : item .UpdatedTime ,
157163 AppKey : item .AppKey ,
@@ -178,6 +184,7 @@ func (user UserDao) FindByAccount(appkey, account string) (*models.User, error)
178184 Email : item .Email ,
179185 LoginAccount : item .LoginAccount ,
180186 LoginPass : item .LoginPass ,
187+ Status : item .Status ,
181188 CreatedTime : item .CreatedTime ,
182189 UpdatedTime : item .UpdatedTime ,
183190 AppKey : item .AppKey ,
@@ -259,6 +266,10 @@ func (user UserDao) UpdateEmail(appkey, userId, email string) error {
259266 return dbcommons .GetDb ().Model (& UserDao {}).Where ("app_key=? and user_id=?" , appkey , userId ).Update ("email" , email ).Error
260267}
261268
269+ func (user UserDao ) UpdateStatus (appkey , userId string , status models.UserStatus ) error {
270+ return dbcommons .GetDb ().Model (& UserDao {}).Where ("app_key=? and user_id=?" , appkey , userId ).Update ("status" , status ).Error
271+ }
272+
262273func (user UserDao ) Count (appkey string ) int {
263274 var count int
264275 err := dbcommons .GetDb ().Model (& UserDao {}).Where ("app_key=?" , appkey ).Count (& count ).Error
@@ -311,6 +322,7 @@ func (user UserDao) QryUsers(appkey, name string, startId, limit int64, isPositi
311322 Email : item .Email ,
312323 LoginAccount : item .LoginAccount ,
313324 LoginPass : item .LoginPass ,
325+ Status : item .Status ,
314326 CreatedTime : item .CreatedTime ,
315327 UpdatedTime : item .UpdatedTime ,
316328 AppKey : item .AppKey ,
0 commit comments