Browse Source

蜂蜜分红-兑换贡献值

master
dengbiao 2 months ago
parent
commit
94cbf0dfb7
7 changed files with 97 additions and 0 deletions
  1. +7
    -0
      src/dao/honey_contribution_exchange_records_dao.go
  2. +10
    -0
      src/dao/honey_contribution_exchange_records_with_flow_dao.go
  3. +31
    -0
      src/implement/honey_contribution_exchange_records_db.go
  4. +23
    -0
      src/implement/honey_contribution_exchange_records_with_flow_db.go
  5. +13
    -0
      src/models/honey_contribution_exchange_records.go
  6. +11
    -0
      src/models/honey_contribution_exchange_records_with_flow.go
  7. +2
    -0
      src/models/honey_dividend_basic.go

+ 7
- 0
src/dao/honey_contribution_exchange_records_dao.go View File

@@ -0,0 +1,7 @@
package dao

import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"

type HoneyContributionExchangeRecordsDao interface {
UpdateHoneyContributionExchangeRecords(m *models.HoneyContributionExchangeRecords, forceColums ...string) (int64, error)
}

+ 10
- 0
src/dao/honey_contribution_exchange_records_with_flow_dao.go View File

@@ -0,0 +1,10 @@
package dao

import (
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"
"xorm.io/xorm"
)

type HoneyContributionExchangeRecordsWithFlowDao interface {
HoneyContributionExchangeRecordsWithFlowInsert(session *xorm.Session, honeyContributionExchangeRecordsWithFlow *models.HoneyContributionExchangeRecordsWithFlow) (int64, error)
}

+ 31
- 0
src/implement/honey_contribution_exchange_records_db.go View File

@@ -0,0 +1,31 @@
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"
"xorm.io/xorm"
)

type HoneyContributionExchangeRecordsDb struct {
Db *xorm.Engine
}

func NewHoneyContributionExchangeRecordsDb(engine *xorm.Engine) dao.HoneyContributionExchangeRecordsDao {
return &HoneyContributionExchangeRecordsDb{Db: engine}
}

func (h HoneyContributionExchangeRecordsDb) UpdateHoneyContributionExchangeRecords(m *models.HoneyContributionExchangeRecords, forceColums ...string) (int64, error) {
var (
affected int64
err error
)
if forceColums != nil {
affected, err = h.Db.Where("id=?", m.Id).Cols(forceColums...).Update(m)
} else {
affected, err = h.Db.Where("id=?", m.Id).Update(m)
}
if err != nil {
return 0, err
}
return affected, nil
}

+ 23
- 0
src/implement/honey_contribution_exchange_records_with_flow_db.go View File

@@ -0,0 +1,23 @@
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"
"xorm.io/xorm"
)

type HoneyContributionExchangeRecordsWithFlowDb struct {
Db *xorm.Engine
}

func NewHoneyContributionExchangeRecordsWithFlowDb(engine *xorm.Engine) dao.HoneyContributionExchangeRecordsWithFlowDao {
return &HoneyContributionExchangeRecordsWithFlowDb{Db: engine}
}

func (h HoneyContributionExchangeRecordsWithFlowDb) HoneyContributionExchangeRecordsWithFlowInsert(session *xorm.Session, honeyContributionExchangeRecordsWithFlow *models.HoneyContributionExchangeRecordsWithFlow) (int64, error) {
_, err := session.InsertOne(honeyContributionExchangeRecordsWithFlow)
if err != nil {
return 0, err
}
return honeyContributionExchangeRecordsWithFlow.Id, nil
}

+ 13
- 0
src/models/honey_contribution_exchange_records.go View File

@@ -0,0 +1,13 @@
package models

type HoneyContributionExchangeRecords struct {
Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"`
Amount string `json:"amount" xorm:"not null default 0.00000000 comment('兑换金额值') DECIMAL(10,8)"`
UserNums int `json:"user_nums" xorm:"not null default 0 comment('参与分红人数') INT(11)"`
TotalContributionValues string `json:"total_contribution_values" xorm:"not null default 0.0000 comment('现场贡献值数') DECIMAL(10,4)"`
TotalExchangeHoneyValues string `json:"total_exchange_honey_values" xorm:"not null default 0.0000 comment('兑换蜂蜜数') DECIMAL(10,4)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"`
State int `json:"state" xorm:"not null default 0 comment('状态(0:待兑换 1:兑换已完成)') TINYINT(1)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 11
- 0
src/models/honey_contribution_exchange_records_with_flow.go View File

@@ -0,0 +1,11 @@
package models

type HoneyContributionExchangeRecordsWithFlow struct {
Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"`
RecordsId int `json:"records_id" xorm:"not null default 0 comment('记录id') INT(11)"`
Uid int `json:"uid" xorm:"not null default 0 comment('uid') INT(11)"`
Amount string `json:"amount" xorm:"not null default 0.0000 comment('兑换蜂蜜数量') DECIMAL(10,4)"`
DestroyValues string `json:"destroy_values" xorm:"not null default 0.0000 comment('销毁贡献值数量') DECIMAL(10,4)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 2
- 0
src/models/honey_dividend_basic.go View File

@@ -8,6 +8,8 @@ type HoneyDividendBasic struct {
DividendVipLevel int `json:"dividend_vip_level" xorm:"not null default 0 comment('分红会员等级(大于等于)') INT(11)"`
EveryMonthExchangeOneCashDestroyHoneyValues string `json:"every_month_exchange_one_cash_destroy_honey_values" xorm:"not null default 0.0000 comment('每月兑换一次现金销毁x蜂蜜') DECIMAL(10,4)"`
CoinId int `json:"coin_id" xorm:"not null default 0 comment('虚拟币id(作用于蜂蜜)') INT(11)"`
CoinIdForContribution int `json:"coin_id_for_contribution" xorm:"not null default 0 comment('虚拟币id(作用于贡献值)') INT(11)"`
ContributionExchangeLowerLimit int `json:"contribution_exchange_lower_limit" xorm:"not null default 0 comment('贡献值最低兑换数量') INT(11)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"`
}

Loading…
Cancel
Save