From 1e02085f73c4b88d5868fd3e0db159ffc750bd40 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 18 Jul 2024 16:55:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9E=9C=E5=9B=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/happy_orchard_basic_setting.go | 5 +++++ 1 file changed, 5 insertions(+) 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"` } From 3bfa840346613daa8192c24bdb1c5b96f938316c Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 19 Jul 2024 10:11:46 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9E=9C=E5=9B=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dao/happy_orchard_six_energy_ball_dao.go | 10 +++++++ .../happy_orchard_six_energy_ball_db.go | 28 +++++++++++++++++++ src/models/happy_orchard_six_energy_ball.go | 9 ++++++ 3 files changed, 47 insertions(+) create mode 100644 src/dao/happy_orchard_six_energy_ball_dao.go create mode 100644 src/implement/happy_orchard_six_energy_ball_db.go create mode 100644 src/models/happy_orchard_six_energy_ball.go 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..603593c --- /dev/null +++ b/src/dao/happy_orchard_six_energy_ball_dao.go @@ -0,0 +1,10 @@ +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) +} 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..4caf71b --- /dev/null +++ b/src/implement/happy_orchard_six_energy_ball_db.go @@ -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 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 +} 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)"` +} From 53198786e5e09237f0cb93935d2196387712bca3 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 19 Jul 2024 10:58:34 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9E=9C=E5=9B=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dao/happy_orchard_six_energy_ball_dao.go | 1 + src/implement/happy_orchard_six_energy_ball_db.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/dao/happy_orchard_six_energy_ball_dao.go b/src/dao/happy_orchard_six_energy_ball_dao.go index 603593c..f528394 100644 --- a/src/dao/happy_orchard_six_energy_ball_dao.go +++ b/src/dao/happy_orchard_six_energy_ball_dao.go @@ -7,4 +7,5 @@ import ( 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 index 4caf71b..abb0834 100644 --- a/src/implement/happy_orchard_six_energy_ball_db.go +++ b/src/implement/happy_orchard_six_energy_ball_db.go @@ -26,3 +26,11 @@ func (h HappyOrchardSixEnergyBallDb) GetHappyOrchardSixEnergyBall(sess *xorm.Ses } 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 +} From 63df5271efb2c6caaa7da6a2d4c5ed0ad71cd5b1 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 20 Jul 2024 14:22:48 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9E=9C=E5=9B=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/implement/happy_orchard_six_energy_ball_db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/implement/happy_orchard_six_energy_ball_db.go b/src/implement/happy_orchard_six_energy_ball_db.go index abb0834..33701cb 100644 --- a/src/implement/happy_orchard_six_energy_ball_db.go +++ b/src/implement/happy_orchard_six_energy_ball_db.go @@ -28,7 +28,7 @@ func (h HappyOrchardSixEnergyBallDb) GetHappyOrchardSixEnergyBall(sess *xorm.Ses } 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) + err = h.Db.Where("uid=? and sign_time=?", uid, signTime).Find(&m) if err != nil { return nil, zhios_order_relate_logx.Error(err) }