diff --git a/src/dao/happy_orchard_six_energy_ball_dao.go b/src/dao/happy_orchard_six_energy_ball_dao.go new file mode 100644 index 0000000..f528394 --- /dev/null +++ b/src/dao/happy_orchard_six_energy_ball_dao.go @@ -0,0 +1,11 @@ +package dao + +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + "xorm.io/xorm" +) + +type HappyOrchardSixEnergyBallDao interface { + GetHappyOrchardSixEnergyBall(sess *xorm.Session, uid, signTime, ballId int) (m *models.HappyOrchardSixEnergyBall, err error) + GetHappyOrchardSixEnergyBallAll(uid, signTime int) (mm *[]models.HappyOrchardSixEnergyBall, err error) +} diff --git a/src/implement/happy_orchard_six_energy_ball_db.go b/src/implement/happy_orchard_six_energy_ball_db.go new file mode 100644 index 0000000..33701cb --- /dev/null +++ b/src/implement/happy_orchard_six_energy_ball_db.go @@ -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 +} diff --git a/src/models/happy_orchard_basic_setting.go b/src/models/happy_orchard_basic_setting.go index fa24b8a..9706331 100644 --- a/src/models/happy_orchard_basic_setting.go +++ b/src/models/happy_orchard_basic_setting.go @@ -35,4 +35,9 @@ type HappyOrchardBasicSetting struct { UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` SignAdvId int `json:"sign_adv_id" xorm:"not null default 0 comment('签到看的广告ID') TINYINT(1)"` IsCanMultiple int `json:"is_can_multiple" xorm:"not null default 0 comment('是否有翻倍 0否 1是') TINYINT(1)"` + SixEnergyBallIsCanMultiple int `json:"six_energy_ball_is_can_multiple" xorm:"not null default 0 comment('是否有翻倍 0否 1是') TINYINT(1)"` + SixEnergyBallAdvId int `json:"six_energy_ball_adv_id" xorm:"not null default 0 comment('签到看的广告ID') TINYINT(1)"` + IsOpenSixEnergyBall int `json:"is_open_six_energy_ball" xorm:"not null default 1 comment('是否开启7日签到(1:开启 0:关闭)') TINYINT(1)"` + SixEnergyBallRewardData string `json:"six_energy_ball_reward_data" xorm:"not null comment('7日签到奖励数据') TEXT"` + VideoSixEnergyBallRewardData string `json:"video_six_energy_ball_reward_data" xorm:"not null comment('观看视频后的7日签到奖励数据') TEXT"` } diff --git a/src/models/happy_orchard_six_energy_ball.go b/src/models/happy_orchard_six_energy_ball.go new file mode 100644 index 0000000..c81266c --- /dev/null +++ b/src/models/happy_orchard_six_energy_ball.go @@ -0,0 +1,9 @@ +package models + +type HappyOrchardSixEnergyBall struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Uid int `json:"uid" xorm:"default 0 INT(11)"` + BallId int `json:"ball_id" xorm:"default 0 comment('球的id') INT(11)"` + SignTime int `json:"sign_time" xorm:"default 0 comment('20240409') INT(11)"` + Money string `json:"money" xorm:"DECIMAL(20,2)"` +}