|
|
@@ -7,12 +7,36 @@ import ( |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
func NewHappyOrchardRewardExchangeRecordsDb(engine *xorm.Engine) dao.HappyOrchardRewardExchangeRecordsDao { |
|
|
|
return &HappyOrchardRewardExchangeRecordsDb{Db: engine} |
|
|
|
} |
|
|
|
|
|
|
|
type HappyOrchardRewardExchangeRecordsDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func NewHappyOrchardRewardExchangeRecordsDb(engine *xorm.Engine) dao.HappyOrchardRewardExchangeRecordsDao { |
|
|
|
return &HappyOrchardRewardExchangeRecordsDb{Db: engine} |
|
|
|
func (h HappyOrchardRewardExchangeRecordsDb) UpdateHappyOrchardRewardExchangeRecordsBySess(sess *xorm.Session, m *models.HappyOrchardRewardExchangeRecords, forceColums ...string) (int64, error) { |
|
|
|
var ( |
|
|
|
affected int64 |
|
|
|
err error |
|
|
|
) |
|
|
|
if forceColums != nil { |
|
|
|
affected, err = sess.Where("id=?", m.Id).Cols(forceColums...).Update(m) |
|
|
|
} else { |
|
|
|
affected, err = sess.Where("id=?", m.Id).Update(m) |
|
|
|
} |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
} |
|
|
|
return affected, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (h HappyOrchardRewardExchangeRecordsDb) InsertHappyOrchardRewardExchangeRecordsBySess(sess *xorm.Session, m *models.HappyOrchardRewardExchangeRecords) (int, error) { |
|
|
|
_, err := sess.InsertOne(m) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
} |
|
|
|
return m.Id, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (h HappyOrchardRewardExchangeRecordsDb) GetHappyOrchardRewardExchangeRecords(id int) (m *models.HappyOrchardRewardExchangeRecords, err error) { |
|
|
|