Create & Init Project...
This commit is contained in:
22
app/service/live/xrewardcenter/dao/anchorReward/mysql.go
Normal file
22
app/service/live/xrewardcenter/dao/anchorReward/mysql.go
Normal file
@ -0,0 +1,22 @@
|
||||
package anchorReward
|
||||
|
||||
import (
|
||||
"context"
|
||||
model "go-common/app/service/live/xrewardcenter/model/anchorTask"
|
||||
"go-common/library/log"
|
||||
)
|
||||
|
||||
// RawRewardConf return reward config from db.
|
||||
func (d *Dao) RawRewardConf(c context.Context, id int64) (res *model.AnchorRewardConf, err error) {
|
||||
rewards := []*model.AnchorRewardConf{}
|
||||
|
||||
if err := d.orm.Model(&model.AnchorReward{}).Find(&rewards, "id=?", id).Error; err != nil {
|
||||
log.Error("getRewardById (%v) error(%v)", id, err)
|
||||
return nil, err
|
||||
}
|
||||
if len(rewards) != 0 {
|
||||
res = rewards[0]
|
||||
}
|
||||
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user