Explorar el Código

update

master
dengbiao hace 3 meses
padre
commit
f12b0c0ee0
Se han modificado 13 ficheros con 121 adiciones y 4 borrados
  1. +5
    -0
      src/dao/honey_dividend_basic_dao.go
  2. +1
    -0
      src/dao/super_cloud_issuance_copy_writing_dao.go
  3. +2
    -0
      src/dao/super_cloud_issuance_goods_dao.go
  4. +1
    -0
      src/dao/super_cloud_issuance_user_robot_bind_circle_dao.go
  5. +1
    -0
      src/dao/super_cloud_issuance_user_robot_dao.go
  6. +14
    -0
      src/implement/honey_dividend_basic_db.go
  7. +13
    -0
      src/implement/super_cloud_issuance_copy_writing_db.go
  8. +23
    -2
      src/implement/super_cloud_issuance_goods_db.go
  9. +11
    -2
      src/implement/super_cloud_issuance_user_robot_bind_circle_db.go
  10. +8
    -0
      src/implement/super_cloud_issuance_user_robot_db.go
  11. +16
    -0
      src/models/honey_dividend_basic.go
  12. +16
    -0
      src/models/honey_dividends_records.go
  13. +10
    -0
      src/models/honey_dividends_records_with_flow.go

+ 5
- 0
src/dao/honey_dividend_basic_dao.go Ver fichero

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

type HoneyDividendBasicDao interface {
//TODO:: You can add specific method definitions here
}

+ 1
- 0
src/dao/super_cloud_issuance_copy_writing_dao.go Ver fichero

@@ -4,4 +4,5 @@ import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"

type SuperCloudIssuanceCopyWritingDao interface {
FindSuperCloudIssuanceCopyWriting() (mm *[]models.SuperCloudIssuanceCopyWriting, err error)
GetSuperCloudIssuanceCopyWriting(pvd string) (m *models.SuperCloudIssuanceCopyWriting, err error)
}

+ 2
- 0
src/dao/super_cloud_issuance_goods_dao.go Ver fichero

@@ -4,4 +4,6 @@ import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"

type SuperCloudIssuanceGoodsDao interface {
FindSuperCloudIssuanceGoods(id string, cid, start, limit int) (mm *[]models.SuperCloudIssuanceGoods, err error)
GetSuperCloudIssuanceGoodByCategory(categoryId int) (m *models.SuperCloudIssuanceGoods, err error)
DeleteCloudIssuanceGoods(id interface{}) (affected int64, err error)
}

+ 1
- 0
src/dao/super_cloud_issuance_user_robot_bind_circle_dao.go Ver fichero

@@ -4,4 +4,5 @@ import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"

type SuperCloudIssuanceUserRobotBindCircleDao interface {
GetSuperCloudIssuanceUserRobotBindCircle(uid, robotId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle)
GetSuperCloudIssuanceUserRobotBindCircleByCategory(uid, categoryId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle)
}

+ 1
- 0
src/dao/super_cloud_issuance_user_robot_dao.go Ver fichero

@@ -10,4 +10,5 @@ type SuperCloudIssuanceUserRobotDao interface {
SaveSuperCloudIssuanceUserRobot(id interface{}, m *models.SuperCloudIssuanceUserRobot, forceColums ...string) (affected int64, err error)
GetCloudIssuanceUserFreeRobot() (m *models.SuperCloudIssuanceUserRobot, err error)
InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot, officialDb *xorm.Engine) (id int, err error)
FindOnLineCloudIssuanceUserRobot() (m []*models.SuperCloudIssuanceUserRobot, err error)
}

+ 14
- 0
src/implement/honey_dividend_basic_db.go Ver fichero

@@ -0,0 +1,14 @@
package implement

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

type HoneyDividendBasicDb struct {
Db *xorm.Engine
}

func NewHoneyDividendBasicDb(engine *xorm.Engine) dao.HoneyDividendBasicDao {
return &HoneyDividendBasicDb{Db: engine}
}

+ 13
- 0
src/implement/super_cloud_issuance_copy_writing_db.go Ver fichero

@@ -14,6 +14,19 @@ type SuperCloudIssuanceCopyWritingDb struct {
func NewSuperCloudIssuanceCopyWritingDb(engine *xorm.Engine) dao.SuperCloudIssuanceCopyWritingDao {
return &SuperCloudIssuanceCopyWritingDb{Db: engine}
}

func (h SuperCloudIssuanceCopyWritingDb) GetSuperCloudIssuanceCopyWriting(pvd string) (m *models.SuperCloudIssuanceCopyWriting, err error) {
m = new(models.SuperCloudIssuanceCopyWriting)
has, err := h.Db.Where("provider = ?", pvd).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (h SuperCloudIssuanceCopyWritingDb) FindSuperCloudIssuanceCopyWriting() (mm *[]models.SuperCloudIssuanceCopyWriting, err error) {
var m []models.SuperCloudIssuanceCopyWriting
if err := h.Db.Where("1=1").Find(&m); err != nil {


+ 23
- 2
src/implement/super_cloud_issuance_goods_db.go Ver fichero

@@ -7,13 +7,34 @@ import (
"xorm.io/xorm"
)

func NewSuperCloudIssuanceGoodsDb(engine *xorm.Engine) dao.SuperCloudIssuanceGoodsDao {
return &SuperCloudIssuanceGoodsDb{Db: engine}
}

type SuperCloudIssuanceGoodsDb struct {
Db *xorm.Engine
}

func NewSuperCloudIssuanceGoodsDb(engine *xorm.Engine) dao.SuperCloudIssuanceGoodsDao {
return &SuperCloudIssuanceGoodsDb{Db: engine}
func (h SuperCloudIssuanceGoodsDb) DeleteCloudIssuanceGoods(id interface{}) (affected int64, err error) {
_, err = h.Db.Where("id=?", id).Delete(models.SuperCloudIssuanceGoods{})
if err != nil {
return 0, err
}
return 1, nil
}

func (h SuperCloudIssuanceGoodsDb) GetSuperCloudIssuanceGoodByCategory(categoryId int) (m *models.SuperCloudIssuanceGoods, err error) {
m = new(models.SuperCloudIssuanceGoods)
has, err := h.Db.Where("cloud_issuance_category_id = ?", categoryId).OrderBy("id ASC").Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (h SuperCloudIssuanceGoodsDb) FindSuperCloudIssuanceGoods(id string, cid, start, limit int) (mm *[]models.SuperCloudIssuanceGoods, err error) {
var m []models.SuperCloudIssuanceGoods
sess := h.Db.Where("1=1")


+ 11
- 2
src/implement/super_cloud_issuance_user_robot_bind_circle_db.go Ver fichero

@@ -6,13 +6,22 @@ import (
"xorm.io/xorm"
)

func NewSuperCloudIssuanceUserRobotBindCircleDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindCircleDao {
return &SuperCloudIssuanceUserRobotBindCircleDb{Db: engine}
}

type SuperCloudIssuanceUserRobotBindCircleDb struct {
Db *xorm.Engine
}

func NewSuperCloudIssuanceUserRobotBindCircleDb(engine *xorm.Engine) dao.SuperCloudIssuanceUserRobotBindCircleDao {
return &SuperCloudIssuanceUserRobotBindCircleDb{Db: engine}
func (h SuperCloudIssuanceUserRobotBindCircleDb) GetSuperCloudIssuanceUserRobotBindCircleByCategory(uid, categoryId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle) {
var m models.SuperCloudIssuanceUserRobotBindCircle
if has, err := h.Db.Where("uid =? AND goods_category_id =? AND state =1", uid, categoryId).Get(&m); err != nil || has == false {
return nil
}
return &m
}

func (h SuperCloudIssuanceUserRobotBindCircleDb) GetSuperCloudIssuanceUserRobotBindCircle(uid, robotId int) (mm *models.SuperCloudIssuanceUserRobotBindCircle) {
var m models.SuperCloudIssuanceUserRobotBindCircle
if has, err := h.Db.Where("robot_id=? and uid=?", robotId, uid).Get(&m); err != nil || has == false {


+ 8
- 0
src/implement/super_cloud_issuance_user_robot_db.go Ver fichero

@@ -26,6 +26,14 @@ type SuperCloudIssuanceUserRobotDb struct {
MasterId string `json:"master_id"`
}

func (superCloudIssuanceUserRobotDb *SuperCloudIssuanceUserRobotDb) FindOnLineCloudIssuanceUserRobot() (m []*models.SuperCloudIssuanceUserRobot, err error) {
err = superCloudIssuanceUserRobotDb.Db.Where("login_status =? AND is_enabled =0", 1).OrderBy("id ASC").Find(&m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
return m, nil
}

func (superCloudIssuanceUserRobotDb *SuperCloudIssuanceUserRobotDb) InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot, officialDb *xorm.Engine) (id int, err error) {
_, err = superCloudIssuanceUserRobotDb.Db.InsertOne(m)
if err != nil {


+ 16
- 0
src/models/honey_dividend_basic.go Ver fichero

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

type HoneyDividendBasic struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
IsOpen int `json:"is_open" xorm:"not null default 1 comment('是否开启(1:开启 2:关闭)') TINYINT(1)"`
NowHoneyValues string `json:"now_honey_values" xorm:"not null default 0.0000 comment('现有蜂蜜数量') DECIMAL(10,4)"`
DestroyHoneyValues string `json:"destroy_honey_values" xorm:"not null default 0.0000 comment('销毁蜂蜜数量') DECIMAL(10,4)"`
DividendVipLevel int `json:"dividend_vip_level" xorm:"not null default 0 comment('分红会员等级(大于等于)') INT(11)"`
OneYuanAmountProduceHoneyValues string `json:"one_yuan_amount_produce_honey_values" xorm:"not null default 0.0000 comment('一元销售额产生x蜂蜜') DECIMAL(10,4)"`
RecommendOnePersonProduceHoneyValues string `json:"recommend_one_person_produce_honey_values" xorm:"not null default 0.0000 comment('推荐一人产生x蜂蜜') DECIMAL(10,4)"`
UserRegisterProduceHoneyValues string `json:"user_register_produce_honey_values" xorm:"not null default 0.0000 comment('新用户注册产生x蜂蜜') DECIMAL(10,4)"`
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)"`
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"`
}

+ 16
- 0
src/models/honey_dividends_records.go Ver fichero

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

import (
"time"
)

type HoneyDividendsRecords 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)"`
TotalHoneyValues string `json:"total_honey_values" xorm:"not null default 0.0000 comment('现场蜂蜜数') DECIMAL(10,4)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"`
State int32 `json:"state" xorm:"not null default 0 comment('状态(0:待分红 1:分红已完成)') TINYINT(1)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 10
- 0
src/models/honey_dividends_records_with_flow.go Ver fichero

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

type HoneyDividendsRecordsWithFlow 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)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

Cargando…
Cancelar
Guardar