123456789101112131415161718 |
- package db
- import (
- "context"
- "youngee_b_api/model/gorm_model"
- )
- // FindTeamById 根据团购ID查找门店信息
- func FindTeamById(ctx context.Context, teamId int) (*gorm_model.YounggeeTeamBuying, error) {
- db := GetReadDB(ctx)
- var teamInfo *gorm_model.YounggeeTeamBuying
- whereCondition := gorm_model.YounggeeTeamBuying{TeamBuyingId: teamId}
- err := db.Model(gorm_model.YounggeeTeamBuying{}).Where(whereCondition).Find(&teamInfo).Error
- if err != nil {
- return nil, err
- }
- return teamInfo, nil
- }
|