gorm order the records by preloading data

0

I'm facing a problem that need order the records by using preloading data. My code is like this:

err = db.Model(&model.Product{}).Unscoped().Order("created_at desc").Count(&count).Offset(bound.Offset).Limit(bound.Limit).Preload("Item").Find(&result).Error

so I need get order the results by Item.CreateTime. Do you have any ideas?

nate

Posted 2019-06-03T08:39:36.040

Reputation: 1

No answers