gorm.io/driver/mysql v1.3.2
gorm.io/gorm v1.23.2

使用joins + scanf时 debug打印的sql可以查询到数据 但我的指针对象为null `

NewsJoinType struct {
    Title       string    `json:"title,omitempty"`
    Content     string    `json:"content,omitempty"`
    DisplayName string    `json:"display_name,omitempty"`
    ShowTime    time.Time `json:"show_time"`
    BannerImg   string    `json:"banner_img,omitempty"`
    BottomImg   string    `json:"bottom_img,omitempty"`
}


var newsContent []NewsJoinType
tx := r.db.Debug().Model(&entities.News{}).
    Select("news.title as title,news.content as content,types.display_name as display_name,news.show_time as show_time,news.banner_img as banner_img,news.bottom_img as bottom_img").
    Joins("left join types on types.id = news.type_id").
    Where("news.id = ? and news.is_show = ? and news.show_time <= ? and types.is_show = ?", newsId, 1, time.Now(), 1).Scan(&newsContent)
if tx.Error != nil {
    ctx.Application().Logger().Errorf("[GetNewsByType] get news detail failed,%v", tx.Error)
}

`

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking