package dao import "youngee_b_api/app/entity" type SubAccountDao struct{} func (d SubAccountDao) GetSubAccount(subAccountId int64) (*entity.SubAccount, error) { var subAccount entity.SubAccount err := Db.Model(&entity.SubAccount{}).Where("sub_account_id = ?", subAccountId).Select("sub_account_name, user_id").First(&subAccount).Error if err != nil { return nil, err } return &subAccount, nil } func (d SubAccountDao) GetSubAccountPhone(subAccountId int64) (string, error) { var phone string err := Db.Model(&entity.SubAccount{}).Where("sub_account_id = ?", subAccountId).Select("phone").First(&phone).Error if err != nil { return "", err } return phone, nil }