From b8450fef8baed00a6ed31d0fa6161cd93a140057 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 9 Aug 2022 18:33:49 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=85=B1=E5=AF=8C=E5=88=B6=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user_public_platoon_settlement_records.go | 22 +++++++++---------- ...er_public_platoon_system_punish_records.go | 1 + .../small_public_platoon_relate_commission.go | 6 +++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/db/model/user_public_platoon_settlement_records.go b/db/model/user_public_platoon_settlement_records.go index 6695cd2..fde587d 100644 --- a/db/model/user_public_platoon_settlement_records.go +++ b/db/model/user_public_platoon_settlement_records.go @@ -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"` } diff --git a/db/model/user_public_platoon_system_punish_records.go b/db/model/user_public_platoon_system_punish_records.go index 26ea145..2d5dbbf 100644 --- a/db/model/user_public_platoon_system_punish_records.go +++ b/db/model/user_public_platoon_system_punish_records.go @@ -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"` } diff --git a/rule/small_public_platoon_relate_commission.go b/rule/small_public_platoon_relate_commission.go index c847885..a0c023c 100644 --- a/rule/small_public_platoon_relate_commission.go +++ b/rule/small_public_platoon_relate_commission.go @@ -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, })