From 14acac3a72fe6f060ee6436fe46ace528af6a620 Mon Sep 17 00:00:00 2001 From: Tooooommy Date: Tue, 20 Oct 2020 10:43:36 +0800 Subject: [PATCH] fix:bug --- models/bully_screen_wallet_hisotry.go | 2 +- models/lottery_draw_rule.go | 14 +++++--------- models/order_draw_activity.go | 12 ++++-------- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/models/bully_screen_wallet_hisotry.go b/models/bully_screen_wallet_hisotry.go index 890ac68..d847e2e 100644 --- a/models/bully_screen_wallet_hisotry.go +++ b/models/bully_screen_wallet_hisotry.go @@ -7,7 +7,7 @@ const BSWalletHistoryTableName = TableNamePrefix + "bully_screen_wallet_history" type BullyScreenWalletHistory struct { Id int `json:"id" xorm:"not null autoincr pk INT(11)"` CustomerId int `json:"customer_id" xorm:"not null default 0 comment('客户表id') INT(11)"` - UserId int `json:"customer_id" xorm:"not null default 0 comment('客户表id') INT(11)"` + UserId int `json:"user_id" xorm:"not null default 0 comment('客户表id') INT(11)"` Money float64 `json:"money" xorm:"not null default 0.00 comment('金额[分正负]') DECIMAL(10)"` HisBalance string `json:"his_balance" xorm:"not null default '0' comment('历史霸屏余额') VARCHAR(128)"` Type string `json:"type" xorm:"not null default '' comment('记录类型 霸屏/提现') VARCHAR(128)"` diff --git a/models/lottery_draw_rule.go b/models/lottery_draw_rule.go index 5802a56..e08959f 100644 --- a/models/lottery_draw_rule.go +++ b/models/lottery_draw_rule.go @@ -1,8 +1,6 @@ package models import ( - "time" - "github.com/ouxuanserver/osmanthuswine/src/core" ) @@ -10,16 +8,14 @@ const LotteryDrawRuleTableName = TableNamePrefix + "lottery_draw_rule" //抽奖活动规则 type LotteryDrawRule struct { - Id int `json:"id" xorm:"not null pk autoincr INT(11)` - LotteryDrawActivityId int `json:"lottery_draw_activity_id" description:"红包轮次的id"` + Model `xorm:"extends"` + + LotteryDrawActivityId int `json:"lottery_draw_activity_id" description:"红包轮次的id"` LotteryDrawRuleLadders []*LotteryDrawRuleLadder `json:"lottery_draw_rule_ladder" xorm:"-" description:"阶梯"` - AreaId int `json:"area_id" description:"地区id"` + AreaId int `json:"area_id" description:"地区id"` AreaStatus string `json:"area_status" description:"多地区[开启,关闭]"` - UseTimes int `json:"use_times" description:"使用次数"` + UseTimes int `json:"use_times" description:"使用次数"` PrizeNum int `json:"prize_num" xorm:"-" description:"奖品总数"` - IsDelete bool `json:"is_delete" xorm:"default(0)" description:"是否删除"` - CreatedAt time.Time `json:"-" xorm:"created" description:"创建时间"` - UpdatedAt time.Time `json:"-" xorm:"updated" description:"更新时间"` } func (t *LotteryDrawRule) TableName() string { diff --git a/models/order_draw_activity.go b/models/order_draw_activity.go index 4b68aa3..b44c4dd 100644 --- a/models/order_draw_activity.go +++ b/models/order_draw_activity.go @@ -1,8 +1,6 @@ package models import ( - "time" - "github.com/ouxuanserver/osmanthuswine/src/core" ) @@ -10,16 +8,14 @@ const OrderDrawActivityTableName = TableNamePrefix + "order_draw_activity" //订单抽奖活动 type OrderDrawActivity struct { - Id int `json:"id" xorm:"not null autoincr pk INT(11)` - ActivityId int `json:"activity_id" description:"活动的id"` - CreatorId int `json:"creator_id"` + Model `xorm:"extends"` + + ActivityId int `json:"activity_id" description:"活动的id"` + CreatorId int `json:"creator_id"` OrderDrawActivityName string `json:"order_draw_activity_name"` OrderDrawRule *OrderDrawRule `json:"order_draw_rule" xorm:"-"` MoreAreaMode string `json:"more_area_mode"` IsSuccess bool `json:"is_success"` - IsDelete bool `json:"is_delete" xorm:"default(0)"` - CreatedAt time.Time `json:"-" xorm:"created" description:"创建时间"` - UpdatedAt time.Time `json:"-" xorm:"updated" description:"更新时间"` } func (t *OrderDrawActivity) TableName() string {