|
|
@@ -0,0 +1,36 @@ |
|
|
|
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 HappyOrchardSixEnergyBallDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func NewHappyOrchardSixEnergyBallDb(engine *xorm.Engine) dao.HappyOrchardSixEnergyBallDao { |
|
|
|
return &HappyOrchardSixEnergyBallDb{Db: engine} |
|
|
|
} |
|
|
|
|
|
|
|
func (h HappyOrchardSixEnergyBallDb) GetHappyOrchardSixEnergyBall(sess *xorm.Session, uid, signTime, ballId int) (m *models.HappyOrchardSixEnergyBall, err error) { |
|
|
|
m = new(models.HappyOrchardSixEnergyBall) |
|
|
|
has, err := sess.Where("uid=? and sign_time=? and ball_id=?", uid, signTime, ballId).Get(m) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
if has == false { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
return m, nil |
|
|
|
} |
|
|
|
func (h HappyOrchardSixEnergyBallDb) GetHappyOrchardSixEnergyBallAll(uid, signTime int) (mm *[]models.HappyOrchardSixEnergyBall, err error) { |
|
|
|
var m []models.HappyOrchardSixEnergyBall |
|
|
|
err = h.Db.Where("uid=? and sign_time=?", uid, signTime).Find(&m) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
return &m, nil |
|
|
|
} |