@@ -5,5 +5,5 @@ import ( | |||||
) | ) | ||||
type HappyOrchardRewardDao interface { | type HappyOrchardRewardDao interface { | ||||
GetHappyOrchardRewardDao(id int) (m *models.HappyOrchardReward, err error) | |||||
GetHappyOrchardReward(id int) (m *models.HappyOrchardReward, err error) | |||||
} | } |
@@ -5,5 +5,5 @@ import ( | |||||
) | ) | ||||
type HappyOrchardSeedDao interface { | type HappyOrchardSeedDao interface { | ||||
GetHappyOrchardSeedDao(id int) (m *models.HappyOrchardSeed, err error) | |||||
GetHappyOrchardSeed(id int) (m *models.HappyOrchardSeed, err error) | |||||
} | } |
@@ -0,0 +1,9 @@ | |||||
package dao | |||||
import ( | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
) | |||||
type HappyOrchardUserWatersDao interface { | |||||
GetHappyOrchardUserWaters(uid int) (m *models.HappyOrchardUserWaters, err error) | |||||
} |
@@ -15,7 +15,7 @@ func NewHappyOrchardRewardDb(engine *xorm.Engine) dao.HappyOrchardRewardDao { | |||||
return &happyOrchardRewardDb{Db: engine} | return &happyOrchardRewardDb{Db: engine} | ||||
} | } | ||||
func (h happyOrchardRewardDb) GetHappyOrchardRewardDao(id int) (m *models.HappyOrchardReward, err error) { | |||||
func (h happyOrchardRewardDb) GetHappyOrchardReward(id int) (m *models.HappyOrchardReward, err error) { | |||||
m = new(models.HappyOrchardReward) | m = new(models.HappyOrchardReward) | ||||
has, err := h.Db.Where("id =?", id).Get(m) | has, err := h.Db.Where("id =?", id).Get(m) | ||||
if err != nil { | if err != nil { | ||||
@@ -15,7 +15,7 @@ func NewHappyOrchardSeedDb(engine *xorm.Engine) dao.HappyOrchardSeedDao { | |||||
return &happyOrchardSeedDb{Db: engine} | return &happyOrchardSeedDb{Db: engine} | ||||
} | } | ||||
func (h happyOrchardSeedDb) GetHappyOrchardSeedDao(id int) (m *models.HappyOrchardSeed, err error) { | |||||
func (h happyOrchardSeedDb) GetHappyOrchardSeed(id int) (m *models.HappyOrchardSeed, err error) { | |||||
m = new(models.HappyOrchardSeed) | m = new(models.HappyOrchardSeed) | ||||
has, err := h.Db.Where("id =?", id).Get(m) | has, err := h.Db.Where("id =?", id).Get(m) | ||||
if err != nil { | if err != nil { | ||||
@@ -0,0 +1,28 @@ | |||||
package implement | |||||
import ( | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" | |||||
"xorm.io/xorm" | |||||
) | |||||
type happyOrchardUserWatersDb struct { | |||||
Db *xorm.Engine | |||||
} | |||||
func NewHappyOrchardUserWatersDb(engine *xorm.Engine) dao.HappyOrchardUserWatersDao { | |||||
return &happyOrchardUserWatersDb{Db: engine} | |||||
} | |||||
func (h happyOrchardUserWatersDb) GetHappyOrchardUserWaters(uid int) (m *models.HappyOrchardUserWaters, err error) { | |||||
m = new(models.HappyOrchardUserWaters) | |||||
has, err := h.Db.Where("uid =?", uid).Get(m) | |||||
if err != nil { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
if has == false { | |||||
return nil, nil | |||||
} | |||||
return m, nil | |||||
} |