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] =?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)"` +}