Browse Source

update

tags/v0.0.2
dengbiao 1 month ago
parent
commit
5cfc326586
6 changed files with 78 additions and 38 deletions
  1. +7
    -0
      src/dao/egg_energy_core_data_dao.go
  2. +24
    -0
      src/implement/egg_energy_data_implement.go
  3. +3
    -6
      src/implement/user_relate_implement.go
  4. +18
    -27
      src/model/egg_energy_basic_setting.go
  5. +17
    -0
      src/model/egg_energy_core_data.go
  6. +9
    -5
      src/model/user_relate.go

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

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

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type EggEnergyCoreDataDao interface {
EggEnergyCoreDataGet() (*model.EggEnergyCoreData, error)
}

+ 24
- 0
src/implement/egg_energy_data_implement.go View File

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

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx"
"xorm.io/xorm"
)

func NewEggEnergyCoreDataDb(engine *xorm.Engine) dao.EggEnergyCoreDataDao {
return &EggEnergyCoreDataDb{Db: engine}
}

type EggEnergyCoreDataDb struct {
Db *xorm.Engine
}

func (e EggEnergyCoreDataDb) EggEnergyCoreDataGet() (*model.EggEnergyCoreData, error) {
var m model.EggEnergyCoreData
if has, err := e.Db.Where("id >= 1").Get(&m); err != nil || has == false {
return nil, zhios_order_relate_logx.Error(err)
}
return &m, nil
}

+ 3
- 6
src/implement/user_relate_implement.go View File

@@ -61,13 +61,10 @@ func (u UserRelateDb) SumUserRelateByParentUid(parentUid string) (total int64, u

func (u UserRelateDb) PageFindUserRelateByParentUid(uid int64, page, pageSize int) (*[]model.UserRelate, int64, error) {
var userRelate []model.UserRelate
sess := u.Db.Where("uid = ?", uid)
total, err := sess.Count(userRelate)
sess := u.Db.Where("parent_uid = ?", uid)
count, err := sess.Limit(pageSize, (page-1)*pageSize).Asc("level").FindAndCount(&userRelate)
if err != nil {
return nil, 0, zhios_order_relate_logx.Error(err)
}
if err := sess.Limit(pageSize, (page-1)*pageSize).Asc("level").Find(&userRelate); err != nil {
return nil, 0, zhios_order_relate_logx.Error(err)
}
return &userRelate, total, nil
return &userRelate, count, nil
}

+ 18
- 27
src/model/egg_energy_basic_setting.go View File

@@ -10,33 +10,24 @@ type EggEnergyBasicSetting struct {
ContributionCoinId int `json:"contribution_coin_id" xorm:"not null default 0 comment('贡献值对应虚拟币id') INT(11)"`
TotalIssuanceAmount string `json:"total_issuance_amount" xorm:"not null comment('总发行量') DECIMAL(28,8)"`
TotalTechnologyTeam string `json:"total_technology_team" xorm:"not null comment('技术团队') DECIMAL(28,8)"`
TotalAngelInvestor string `json:"total_angel_investor" xorm:"not null comment('天使投资人') DECIMAL(28,8)"`
TotalAngelInvestor string `json:"total_angel_investor" xorm:"not null pk comment('天使投资人') DECIMAL(28,8)"`
TotalOperateFund string `json:"total_operate_fund" xorm:"not null comment('运营资金') DECIMAL(28,8)"`
TotalEcologicalDevelopment string `json:"total_ecological_development" xorm:"not null comment('生态建设') DECIMAL(28,8)"`
TotalTeamDividends string `json:"total_team_dividends" xorm:"not null comment('团队分红') DECIMAL(28,8)"`
TotalUserForPerson string `json:"total_user_for_person" xorm:"not null comment('个人区域') DECIMAL(28,8)"`
TotalUserForTeam string `json:"total_user_for_team" xorm:"not null comment('团队区域') DECIMAL(28,8)"`
InitialPrice string `json:"initial_price" xorm:"not null comment('初始价格') DECIMAL(28,8)"`
NowPrice string `json:"now_price" xorm:"not null comment('当前价格') DECIMAL(28,8)"`
PlanetTotalValue string `json:"planet_total_value" xorm:"not null comment('星球总价值') DECIMAL(28,8)"`
MarketplaceMerchantNums string `json:"marketplace_merchant_nums" xorm:"not null comment('市商数量') DECIMAL(28,8)"`
MarketplaceMerchantFunds string `json:"marketplace_merchant_funds" xorm:"not null comment('市商资金') DECIMAL(28,8)"`
DevelopmentCommittee string `json:"development_committee" xorm:"not null comment('发展委员会') DECIMAL(28,8)"`
PublicWelfareAndCharity string `json:"public_welfare_and_charity" xorm:"not null comment('公益慈善') DECIMAL(28,8)"`
StarLevelDividends string `json:"star_level_dividends" xorm:"not null comment('星级分红') DECIMAL(28,8)"`
CommunityDividends string `json:"community_dividends" xorm:"not null comment('社区分红') DECIMAL(28,8)"`
DestructionQuantityNums string `json:"destruction_quantity_nums" xorm:"not null comment('销毁数量') DECIMAL(28,8)"`
DestructionSetting string `json:"destruction_setting" xorm:"not null comment('销毁设置') TEXT"`
IsLimitDividend int `json:"is_limit_dividend" xorm:"not null default 1 comment('是否限制分红(会员本人不活跃,没有星级能量分红)') TINYINT(1)"`
SettlementQuantity int `json:"settlement_quantity" xorm:"not null default 0 comment('结算数量(百分比)') INT(11)"`
DirectPushReward string `json:"direct_push_reward" xorm:"not null comment('直推奖励') TEXT"`
PriceSetting string `json:"price_setting" xorm:"not null comment('价格设置') TEXT"`
VipEquitySetting string `json:"vip_equity_setting" xorm:"not null comment('会员权益') TEXT"`
VideoRewardIsOpen int `json:"video_reward_is_open" xorm:"not null default 1 comment('视屏奖励是否开启(1:开启 0:关闭)') TINYINT(1)"`
VideoRewardSystem string `json:"video_reward_system" xorm:"not null comment('视屏奖励机制') TEXT"`
ExchangeRules string `json:"exchange_rules" xorm:"not null comment('兑换规则') TEXT"`
NewUserIncentiveRules string `json:"new_user_incentive_rules" xorm:"not null comment('新用户激励规则') TEXT"`
RewardSystem string `json:"reward_system" xorm:"not null comment('圈层奖励机制') TEXT"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
//TotalTeamDividends string `json:"total_team_dividends" xorm:"not null comment('团队分红') DECIMAL(28,8)"`
TotalUserForPerson string `json:"total_user_for_person" xorm:"not null comment('个人区域') DECIMAL(28,8)"`
TotalUserForTeam string `json:"total_user_for_team" xorm:"not null comment('团队区域') DECIMAL(28,8)"`
InitialPrice string `json:"initial_price" xorm:"not null comment('初始价格') DECIMAL(28,8)"`
DestructionSetting string `json:"destruction_setting" xorm:"not null comment('销毁设置') TEXT"`
IsLimitDividend int `json:"is_limit_dividend" xorm:"not null default 1 comment('是否限制分红(会员本人不活跃,没有星级能量分红)') TINYINT(1)"`
SettlementQuantity int `json:"settlement_quantity" xorm:"not null default 0 comment('结算数量(百分比)') INT(11)"`
DirectPushReward string `json:"direct_push_reward" xorm:"not null comment('直推奖励') TEXT"`
PriceSetting string `json:"price_setting" xorm:"not null comment('价格设置') TEXT"`
VipEquitySetting string `json:"vip_equity_setting" xorm:"not null comment('会员权益') TEXT"`
VideoRewardIsOpen int `json:"video_reward_is_open" xorm:"not null default 1 comment('视屏奖励是否开启(1:开启 0:关闭)') TINYINT(1)"`
VideoRewardSystem string `json:"video_reward_system" xorm:"not null comment('视屏奖励机制') TEXT"`
ExchangeRules string `json:"exchange_rules" xorm:"not null comment('兑换规则') TEXT"`
NewUserIncentiveRules string `json:"new_user_incentive_rules" xorm:"not null comment('新用户激励规则') TEXT"`
RewardSystem string `json:"reward_system" xorm:"comment('圈层奖励机制') TEXT"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 17
- 0
src/model/egg_energy_core_data.go View File

@@ -0,0 +1,17 @@
package model

type EggEnergyCoreData struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
NowPrice string `json:"now_price" xorm:"not null comment('当前价格') DECIMAL(28,8)"`
PlanetTotalValue string `json:"planet_total_value" xorm:"not null comment('星球总价值') DECIMAL(28,8)"`
NowEnergyTotalNums string `json:"now_energy_total_nums" xorm:"not null comment('现行总量') DECIMAL(28,8)"`
MarketplaceMerchantNums string `json:"marketplace_merchant_nums" xorm:"not null comment('市商数量') DECIMAL(28,8)"`
MarketplaceMerchantFunds string `json:"marketplace_merchant_funds" xorm:"not null comment('市商资金') DECIMAL(28,8)"`
DevelopmentCommittee string `json:"development_committee" xorm:"not null comment('发展委员会') DECIMAL(28,8)"`
PublicWelfareAndCharity string `json:"public_welfare_and_charity" xorm:"not null comment('公益慈善') DECIMAL(28,8)"`
StarLevelDividends string `json:"star_level_dividends" xorm:"not null comment('星级分红') DECIMAL(28,8)"`
CommunityDividends string `json:"community_dividends" xorm:"not null comment('社区分红') DECIMAL(28,8)"`
DestructionQuantityNums string `json:"destruction_quantity_nums" xorm:"not null DECIMAL(28,8)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 9
- 5
src/model/user_relate.go View File

@@ -1,9 +1,13 @@
package model

import (
"time"
)

type UserRelate struct {
Id int64 `json:"id" xorm:"pk autoincr comment('主键') BIGINT(10)"`
ParentUid int `json:"parent_uid" xorm:"not null default 0 comment('上级会员ID') unique(idx_union_u_p_id) INT(20)"`
Uid int64 `json:"uid" xorm:"not null default 0 comment('关联UserID') unique(idx_union_u_p_id) INT(20)"`
Level int `json:"level" xorm:"not null default 1 comment('推广等级(1直属,大于1非直属)') INT(10)"`
InviteTime string `json:"invite_time" xorm:"default 'CURRENT_TIMESTAMP' comment('邀请时间') TIMESTAMP"`
Id int64 `json:"id" xorm:"pk autoincr comment('主键') BIGINT(10)"`
ParentUid int `json:"parent_uid" xorm:"not null default 0 comment('上级会员ID') unique(idx_union_u_p_id) INT(20)"`
Uid int `json:"uid" xorm:"not null default 0 comment('关联UserID') unique(idx_union_u_p_id) INT(20)"`
Level int `json:"level" xorm:"not null default 1 comment('推广等级(1直属,大于1非直属)') INT(10)"`
InviteTime time.Time `json:"invite_time" xorm:"default 'CURRENT_TIMESTAMP' comment('邀请时间') TIMESTAMP"`
}

Loading…
Cancel
Save