|
@@ -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")
|