Xingyu Xian 1 week ago
parent
commit
ecc1416fa5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      db/user.go

+ 1 - 1
db/user.go

@@ -35,7 +35,7 @@ func GetUserByPhone(ctx context.Context, phone string) (*gorm_model.YounggeeUser
 func GetSubUserByPhone(ctx context.Context, phone string) (*gorm_model.YounggeeUser, error) {
 	db := GetReadDB(ctx)
 	user := &gorm_model.YounggeeUser{}
-	err := db.Model(user).Where("phone = ?", phone).First(user).Error
+	err := db.Model(user).Where("phone = ? AND role = 4", phone).First(user).Error
 	if err != nil {
 		if err == gorm.ErrRecordNotFound {
 			fmt.Println("record not found")