Skip to content

Commit

Permalink
creative_repository link, endcard_link取得の追加
Browse files Browse the repository at this point in the history
  • Loading branch information
NaoyukiGouko committed Nov 11, 2024
1 parent b9186cb commit ff03e7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manager/infra/creative_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func (c *CreativeRepository) GetCreativeByCampaignID(ctx context.Context, tx rep
query := `
SELECT
creative.id as id,
creative.click_url as link,
COALESCE(banner.height, video.height) AS height,
COALESCE(banner.width, video.width) AS width,
COALESCE(banner.img_url, video.video_url) AS url,
Expand All @@ -36,6 +37,7 @@ func (c *CreativeRepository) GetCreativeByCampaignID(ctx context.Context, tx rep
WHEN video.id IS NOT NULL THEN video.extension
END AS extension,
IFNULL(video.endcard_url, '') AS end_card_url,
IFNULL(video.endcard_link, '') AS end_card_link,
video.endcard_width AS end_card_width,
video.endcard_height AS end_card_height,
IFNULL(video.endcard_extension, '') AS end_card_extension
Expand All @@ -46,7 +48,7 @@ func (c *CreativeRepository) GetCreativeByCampaignID(ctx context.Context, tx rep
LEFT JOIN video ON creative.video_id = video.id
WHERE campaign.id = :campaign_id
GROUP BY
creative.id, banner.id, video.id, video.endcard_url, video.endcard_width, video.endcard_height, video.endcard_extension
creative.id, creative.click_url, banner.id, video.id, video.endcard_url, video.endcard_link, video.endcard_width, video.endcard_height, video.endcard_extension
LIMIT :limit
`
stmt, err := tx.(*Transaction).Tx.PrepareNamedContext(ctx, query)
Expand Down

0 comments on commit ff03e7c

Please sign in to comment.