Ver código fonte

果园

master
huangjiajun 4 meses atrás
pai
commit
3bfa840346
3 arquivos alterados com 47 adições e 0 exclusões
  1. +10
    -0
      src/dao/happy_orchard_six_energy_ball_dao.go
  2. +28
    -0
      src/implement/happy_orchard_six_energy_ball_db.go
  3. +9
    -0
      src/models/happy_orchard_six_energy_ball.go

+ 10
- 0
src/dao/happy_orchard_six_energy_ball_dao.go Ver arquivo

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

+ 28
- 0
src/implement/happy_orchard_six_energy_ball_db.go Ver arquivo

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

+ 9
- 0
src/models/happy_orchard_six_energy_ball.go Ver arquivo

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

Carregando…
Cancelar
Salvar