dengbiao 3 months ago
parent
commit
ac40f18e47
4 changed files with 61 additions and 0 deletions
  1. +11
    -0
      src/dao/happy_orchard_six_energy_ball_dao.go
  2. +36
    -0
      src/implement/happy_orchard_six_energy_ball_db.go
  3. +5
    -0
      src/models/happy_orchard_basic_setting.go
  4. +9
    -0
      src/models/happy_orchard_six_energy_ball.go

+ 11
- 0
src/dao/happy_orchard_six_energy_ball_dao.go View File

@@ -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)
}

+ 36
- 0
src/implement/happy_orchard_six_energy_ball_db.go View File

@@ -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
}

+ 5
- 0
src/models/happy_orchard_basic_setting.go View File

@@ -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"`
}

+ 9
- 0
src/models/happy_orchard_six_energy_ball.go View File

@@ -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)"`
}

Loading…
Cancel
Save