想要使用关联关系的时候 right join 怎么操作呀
type Card struct {
Id int `json:"id,omitempty" gorm:"column:id"`
Amount float64 `json:"amount,omitempty" gorm:"column:amount"`
Currency string `json:"currency,omitempty" gorm:"column:currency"`
GiftCard Giftcard `json:"giftCard,omitempty" gorm:"foreignKey:CardId"`
CardConsumer CardConsumer `json:"consumer,omitempty" gorm:"foreignKey:CardId"`
}
// 这里只能 left join GiftCard 和left join CardConsumer
// 如何实现 right join
r.db.Joins("GiftCard").Joins("CardConsumer").Find(&card)
这里只能 left join GiftCard 和left join CardConsumer
如何实现 right join
4872
@jinzhu
Comment From: github-actions[bot]
This issue has been automatically marked as stale because it has been open 360 days with no activity. Remove stale label or comment or this will be closed in 180 days