Browse Source

fix:bug

token_replace
黄梓健 4 years ago
parent
commit
28bdea2be0
  1. 2
      controllers/client/order_entry.go
  2. 8
      controllers/pc/lottery_draw.go
  3. 3
      main.go
  4. 2
      models/activity.go
  5. 2
      models/arch.go
  6. 4
      models/base.go
  7. 2
      models/bully_screen_server.go
  8. 2
      models/bully_screen_wallet.go
  9. 2
      models/customer_operation.go
  10. 2
      models/dan_mu_server.go
  11. 2
      models/invitation.go
  12. 2
      models/lottery_draw_activity.go
  13. 2
      models/lottery_draw_envelope_wallet.go
  14. 2
      models/lottery_draw_rule.go
  15. 2
      models/lottery_draw_rule_ladder.go
  16. 2
      models/lottery_draw_wallet_history.go
  17. 2
      models/module_service.go
  18. 2
      models/module_style.go
  19. 2
      models/order_draw_activity.go
  20. 2
      models/order_draw_rule.go
  21. 2
      models/order_draw_style.go
  22. 2
      models/reward_server.go
  23. 2
      models/reward_wallet.go
  24. 2
      models/sensitive.go
  25. 2
      models/shake_red_envelope_rule_ladder.go
  26. 2
      models/shake_red_envelope_wallet.go
  27. 2
      models/shake_red_envelope_wallet_history.go
  28. 2
      models/user_wallet_history.go

2
controllers/client/order_entry.go

@ -209,7 +209,7 @@ func (t *OrderEntryCtl) Order() {
}
if prize.Id > 0 {
order.UserPrizeId = prize.Id
_, err = s.ID(order.Id).NoAutoCondition().Cols("user_prize_id").Update(order)
_, err = s.ID(order.Id).NoAutoCondition().Cols("user_prize_id").Update(&order)
if err != nil {
s.Rollback()
t.CheckErr(err)

8
controllers/pc/lottery_draw.go

@ -22,13 +22,13 @@ func (t *LotteryDrawCtl) Start() {
ladderId := t.MustGetInt("lottery_draw_ladder_id")
activityId := t.MustGetInt("activity_id")
ladder := new(models.LotteryDrawRuleLadder)
exist, err := models.Get(ladder, ladderId)
ladder := models.LotteryDrawRuleLadder{}
exist, err := models.Get(&ladder, ladderId)
t.CheckErr(err)
t.Assert(exist, code.MSG_LOTTERY_RULE_NOT_EXIST, "抽奖规则不存在")
activity := new(models.Activity)
exist, err = models.Get(activity, activityId)
activity := models.Activity{}
exist, err = models.Get(&activity, activityId)
t.CheckErr(err)
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在")
t.CheckRunning(activity.Status)

3
main.go

@ -6,11 +6,12 @@ import (
"hudongzhuanjia/controllers/client"
"hudongzhuanjia/controllers/common"
"hudongzhuanjia/controllers/pc"
"hudongzhuanjia/utils/define"
//_ "net/http/pprof"
)
func main() {
//define.SetDebug(true)
define.SetDebug(true)
// pc
core.GetInstanceRouterManage().Registered(new(pc.WsCtl)) // 用户

2
models/activity.go

@ -8,7 +8,7 @@ const ActivityTableName = TableNamePrefix + "activity"
//互动活动
type Activity struct {
Id int `json:"id" xorm:"pk autoincr INT(11)"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
CustomerId int `json:"customer_id" xorm:"not null default(0) comment('customer_id, 创建客户id') INT(11)"`
ArchId int `json:"arch_id" xorm:"not null default 0 comment('归档id') INT(11)"`
Services []*ActivityModuleService `json:"services,omitempty" xorm:"-" description:"主活动下的服务"`

2
models/arch.go

@ -9,7 +9,7 @@ import (
const ArchTableName = TableNamePrefix + "arch"
type Arch struct {
Id int `json:"id" xorm:"not null pk INT(11)"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
CustomerId int `json:"customer_id"`
ActivityId int `json:"activity_id"`
Date string `json:"date"`

4
models/base.go

@ -155,9 +155,9 @@ func Add(bean interface{}) (int64, error) {
func Update(id, bean interface{}, field ...string) (int64, error) {
if len(field) > 0 {
return core.GetXormAuto().NoAutoCondition().ID(id).Cols(field...).Update(bean)
return core.GetXormAuto().ID(id).NoAutoCondition().Cols(field...).Update(bean)
} else {
return core.GetXormAuto().NoAutoCondition().ID(id).Update(bean)
return core.GetXormAuto().ID(id).NoAutoCondition().Update(bean)
}
}

2
models/bully_screen_server.go

@ -10,7 +10,7 @@ const BullyScreenServerTableName = TableNamePrefix + "bully_screen_server"
//霸屏服务
type BullyScreenServer struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
ActivityId int `json:"activity_id" description:"主活动的id"`
ServerStartTime time.Time `json:"server_start_time" description:"服务开始时间"`
ServerEndTime time.Time `json:"server_end_time" description:"服务结束时间"`

2
models/bully_screen_wallet.go

@ -9,7 +9,7 @@ import (
const BSWalletTableName = TableNamePrefix + "bully_screen_wallet"
type BullyScreenWallet struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
CustomerId int `json:"customer_id"`
Balance float64 `json:"balance"`
CreatedAt time.Time `json:"created_at"`

2
models/customer_operation.go

@ -10,7 +10,7 @@ import (
// 用户操作, 主从账号同步信息
// 拔河/摇红包/摇奖券/订单/上墙/霸屏/抽奖/投票/竞拍/打赏/会务
type CustomerOperation struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
CustomerId int `json:"customer_id" description:"客户id"`
ActivityId int `json:"activity_id" description:"主活动id"`
AreaId int `json:"area_id" description:"地区id"`

2
models/dan_mu_server.go

@ -9,7 +9,7 @@ import (
const DanMuServerTableName = TableNamePrefix + "dan_mu_server"
type DanMuServer struct {
Id int `json:"id" xorm:"not null pk autoincr"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
ActivityId int `json:"activity_id" xorm:"not null comment('互动id') INT(11)" description:"主活动id"`
DanmuSwitch string `json:"danmu_switch" xorm:"not null default('关闭') comment('弹幕服务开启、关闭') VARCHAR(255)"`
DanmuOpacity int `json:"danmu_opacity" xorm:"not null default(100) comment('弹幕透明度') INT(11)"`

2
models/invitation.go

@ -7,7 +7,7 @@ import (
)
type Invitation struct {
Id int `json:"id" description:"主键"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)"`
ActivityId int `json:"activity_id" xorm:"not null comment('主活动id')" description:"主活动id"`
SettingBox string `json:"setting_box" xorm:"not null comment('表单选项json化')" description:"表单选项Json化"`
SelfBox string `json:"self_box" xorm:"not null comment('表单选项json化')" description:"自定义表单选项json"`

2
models/lottery_draw_activity.go

@ -10,7 +10,7 @@ const LotteryDrawActivityTableName = TableNamePrefix + "lottery_draw_activity"
//抽奖活动
type LotteryDrawActivity struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
ActivityId int `json:"activity_id" description:"主活动的id"`
CreatorId int `json:"creator_id" description:"创建者id"`
LotteryDrawActivityName string `json:"lottery_draw_activity_name" description:"抽奖轮次名称"`

2
models/lottery_draw_envelope_wallet.go

@ -6,7 +6,7 @@ import (
//抽奖红包钱包
type LotteryDrawEnvelopeWallet struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)"`
CustomerId int `json:"customer_id" description:"客户id"`
Balance float64 `json:"balance" description:"余额"`
IsDelete bool `json:"is_delete" xorm:"default(0)"`

2
models/lottery_draw_rule.go

@ -10,7 +10,7 @@ const LotteryDrawRuleTableName = TableNamePrefix + "lottery_draw_rule"
//抽奖活动规则
type LotteryDrawRule struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)`
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"`

2
models/lottery_draw_rule_ladder.go

@ -11,7 +11,7 @@ const LotteryDrawRuleLadderTableName = TableNamePrefix + "lottery_draw_rule_ladd
//抽奖活动规则阶梯
type LotteryDrawRuleLadder struct {
Id int `json:"id"`
Id int `json:"id" xorm:"autoincr pk not null INT(11)"`
LotteryDrawRuleId int `json:"lottery_draw_rule_id" description:"红包轮次的id"`
RollNum int `json:"roll_num" xorm:"not null default 0 comment('滚动次数') INT(11)"`
PrizeName string `json:"prize_name" description:"奖品名字"`

2
models/lottery_draw_wallet_history.go

@ -6,7 +6,7 @@ import (
//抽奖活动钱包历史
type LotteryDrawWalletHistory struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
CustomerId int `json:"customer_id" description:"客户id"`
Money float64 `json:"money" description:"金额[分正负]"`
Mark string `json:"mark" description:"备注"`

2
models/module_service.go

@ -8,7 +8,7 @@ import (
//模块服务表
type ModuleService struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)"`
Name string `json:"name" description:"模块的名称"`
Price float64 `json:"price" description:"模块价格"`
Free string `json:"free" description:"模块是否收费[收费|免费]"`

2
models/module_style.go

@ -6,7 +6,7 @@ import (
//模块样式表
type ModuleStyle struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)"`
ModuleServiceId int `json:"module_service_id" description:"服务模块的id"`
StyleName string `json:"style_name" description:"样式名字"`
StyleImage string `json:"style_image" description:"样式图片"`

2
models/order_draw_activity.go

@ -10,7 +10,7 @@ const OrderDrawActivityTableName = TableNamePrefix + "order_draw_activity"
//订单抽奖活动
type OrderDrawActivity struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)`
ActivityId int `json:"activity_id" description:"活动的id"`
CreatorId int `json:"creator_id"`
OrderDrawActivityName string `json:"order_draw_activity_name"`

2
models/order_draw_rule.go

@ -10,7 +10,7 @@ const OrderDrawRuleTableName = TableNamePrefix + "order_draw_rule"
//订单抽奖抽奖规则
type OrderDrawRule struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)"`
OrderDrawActivityId int `json:"order_lottery_draw_activity_id" description:"订单抽奖活动的的id"`
OrderDrawRuleLadders []*OrderDrawRuleLadder `json:"order_draw_rule_ladders" xorm:"-"`
AreaId int `json:"area_id" description:"地区id"`

2
models/order_draw_style.go

@ -6,7 +6,7 @@ import (
//订单抽奖样式
type OrderDrawStyle struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)"`
StyleName string `json:"style_name" description:"样式的名字"`
StyleImageUrl string `json:"style_image_url" description:"样式的图片地址"`
IsDelete bool `json:"is_delete" xorm:"default(0)" description:"是否删除"`

2
models/reward_server.go

@ -10,7 +10,7 @@ const RewardServerTableName = TableNamePrefix + "reward_server"
//打赏服务
type RewardServer struct {
Id int `json:"id" xorm:"pk autoincr"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
ActivityId int `json:"activity_id" xorm:"not null comment('主活动id')" description:"主活动id"`
ServerStartTime time.Time `json:"server_start_time" xorm:"not null comment('服务开始时间')" description:"服务开始时间"`
ServerEndTime time.Time `json:"server_end_time" xorm:"not null comment('服务结束时间')" description:"服务结束时间"`

2
models/reward_wallet.go

@ -10,7 +10,7 @@ const RewardWalletTableName = TableNamePrefix + "reward_wallet"
//打赏钱包
type RewardWallet struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)"`
CustomerId int `json:"customer_id" description:"客户id"`
Balance float64 `json:"balance" description:"余额"`
IsDelete bool `json:"is_delete" xorm:"default(0)"`

2
models/sensitive.go

@ -8,7 +8,7 @@ import (
)
type Sensitive struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)"`
Keyword string `json:"keyword" description:"关键字"`
Host string `json:"host" description:"二级域名"`
Category string `json:"category" description:"类别"`

2
models/shake_red_envelope_rule_ladder.go

@ -8,7 +8,7 @@ const ShakeRedEnvelopeRuleLadderTableName = TableNamePrefix + "shake_red_envelop
//摇红包规则阶梯
type ShakeRedEnvelopeRuleLadder struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)"`
ShakeRedEnvelopeRuleId int `json:"shake_red_envelope_rule_id" description:"红包轮次的id"`
RedEnvelopeNum int `json:"red_envelope_num" description:"红包个数"`
Probability float64 `json:"probability" description:"概率"`

2
models/shake_red_envelope_wallet.go

@ -4,7 +4,7 @@ import "time"
//摇红包钱包
type ShakeRedEnvelopeWallet struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)"`
CustomerId int `json:"customer_id" description:"客户id"`
Balance float64 `json:"balance" description:"余额"`
IsDelete bool `json:"is_delete" xorm:"default(0)" description:"是否删除"`

2
models/shake_red_envelope_wallet_history.go

@ -4,7 +4,7 @@ import "time"
//摇红包钱包历史
type ShakeRedEnvelopeWalletHistory struct {
Id int `json:"id"`
Id int `json:"id" xorm:"not null autoincr pk INT(11)"`
CustomerId int `json:"customer_id" description:"客户id"`
HisBalance float64 `json:"his_balance" description:"历史余额"`
Type string `json:"type" description:"记录类型 充值、消费、转出、未领取、发送失败"`

2
models/user_wallet_history.go

@ -6,7 +6,7 @@ import (
//用户得钱包流水
type UserWalletHistory struct {
Id int `json:"id" xorm:"pk autoincr INT(11)"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
UserId int `json:"user_id" xorm:"not null comment('用户id') INT(11)"`
Amount float64 `json:"amount" xorm:"not null comment('金额, 分正负') DECIMAL"`
Mark string `json:"mark" xorm:"not null comment('备注') VARCHAR(125)"`

Loading…
Cancel
Save