Xingyu Xian 1 개월 전
부모
커밋
ecc1416fa5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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")