Procházet zdrojové kódy

update 共富制度

tags/v1.6.8
DengBiao před 2 roky
rodič
revize
b8450fef8b
3 změnil soubory, kde provedl 15 přidání a 14 odebrání
  1. +10
    -12
      db/model/user_public_platoon_settlement_records.go
  2. +1
    -0
      db/model/user_public_platoon_system_punish_records.go
  3. +4
    -2
      rule/small_public_platoon_relate_commission.go

+ 10
- 12
db/model/user_public_platoon_settlement_records.go Zobrazit soubor

@@ -5,16 +5,14 @@ import (
)

type UserPublicPlatoonSettlementRecords struct {
Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"`
Uid int `json:"uid" xorm:"not null comment('用户id') index INT(11)"`
CoinId int `json:"coin_id" xorm:"not null default 0 comment('虚拟币id(0为金额)') INT(11)"`
Amount string `json:"amount" xorm:"not null default '' comment('结算金额') VARCHAR(50)"`
Title string `json:"title" xorm:"comment('标题') VARCHAR(255)"`
Date string `json:"date" xorm:"not null default '' comment('结算日期(0000-00)') VARCHAR(50)"`
Kind int `json:"kind" xorm:"not null default 1 comment('结算种类(1:转入用户余额 2:清零)') 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"`
Oid string `json:"oid" xorm:"comment('订单号') VARCHAR(100)"`
Type int `json:"type" xorm:"not null default 0 comment('0收入 1支出') INT(11)"`
BeforeAmount string `json:"before_amount" xorm:"comment('变更前金额') VARCHAR(100)"`
Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"`
Uid int `json:"uid" xorm:"not null comment('用户id') index INT(11)"`
CoinId int `json:"coin_id" xorm:"not null default 0 comment('虚拟币id(0为金额)') INT(11)"`
Amount string `json:"amount" xorm:"not null default '' comment('结算金额') VARCHAR(50)"`
Title string `json:"title" xorm:"comment('标题') VARCHAR(255)"`
Date string `json:"date" xorm:"not null default '' comment('结算日期(0000-00)') VARCHAR(50)"`
Kind int `json:"kind" xorm:"not null default 1 comment('结算种类(1:转入用户余额 2:清零)') TINYINT(1)"`
Type int `json:"type" xorm:"not null default 1 comment('类型(1:大公排 2:小公排)') 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"`
}

+ 1
- 0
db/model/user_public_platoon_system_punish_records.go Zobrazit soubor

@@ -12,6 +12,7 @@ type UserPublicPlatoonSystemPunishRecords struct {
Date string `json:"date" xorm:"not null default '' comment('日期(0000-00)') VARCHAR(50)"`
Title string `json:"title" xorm:"not null default '' comment('标题') VARCHAR(100)"`
Reason string `json:"reason" xorm:"not null default '' comment('原因') VARCHAR(255)"`
Type int `json:"type" xorm:"not null default 1 comment('类型(1:大公排 2:小公排)') 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"`
}

+ 4
- 2
rule/small_public_platoon_relate_commission.go Zobrazit soubor

@@ -476,6 +476,7 @@ func SmallDealCommonWealthReward(engine *xorm.Engine, uid int, isCompleteReward
Amount: param.Amount,
Title: "结算共富奖励",
Date: now.AddDate(0, 0, 30).Format("2006-01-02"),
Type: 2,
CreateAt: now,
UpdateAt: now,
}
@@ -561,7 +562,7 @@ func SmallDealCommonWealthPunish(engine *xorm.Engine, uid int, reason string) (e
}

//2、查询出 `user_public_platoon_relation` 中相关记录 && 将该记录的uid置为 -1
params, err := db.UserPublicPlatoonRelationGetOneByParams(engine, map[string]interface{}{
params, err := db.UserSmallPublicPlatoonRelationGetOneByParams(engine, map[string]interface{}{
"key": "uid",
"value": uid,
})
@@ -580,7 +581,7 @@ func SmallDealCommonWealthPunish(engine *xorm.Engine, uid int, reason string) (e
params.Uid = -2
}

updateAffected, err := db.UserPublicPlatoonRelationUpdate(session, params.Id, params)
updateAffected, err := db.UserSmallPublicPlatoonRelationUpdate(session, params.Id, params)
if err != nil {
_ = session.Rollback()
return
@@ -607,6 +608,7 @@ func SmallDealCommonWealthPunish(engine *xorm.Engine, uid int, reason string) (e
Date: now.AddDate(0, 0, 30).Format("2006-01-02"),
Title: "共富收益-系统处罚记录",
Reason: reason,
Type: 2,
CreateAt: now,
UpdateAt: now,
})


Načítá se…
Zrušit
Uložit