project_brief.go 660 B

1234567891011121314151617181920
  1. package db
  2. import (
  3. "context"
  4. "github.com/sirupsen/logrus"
  5. "youngee_b_api/model/gorm_model"
  6. )
  7. // FindProjectBriefByProjectId 根据projectId查找Brief
  8. func FindProjectBriefByProjectId(ctx context.Context, projectId string) ([]*gorm_model.YounggeeProjectBrief, error) {
  9. db := GetReadDB(ctx)
  10. var sProjectInfo []*gorm_model.YounggeeProjectBrief
  11. // 1. 根据服务商种草任务id过滤
  12. err := db.Model(gorm_model.YounggeeProjectBrief{}).Where("project_id = ?", projectId).Find(&sProjectInfo).Error
  13. if err != nil {
  14. logrus.WithContext(ctx).Errorf("[GetSProjectDetail] error query mysql, err:%+v", err)
  15. return nil, err
  16. }
  17. return sProjectInfo, nil
  18. }