You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
643 B
25 lines
643 B
package common |
|
|
|
import ( |
|
"server/call" |
|
"server/common" |
|
"server/db" |
|
"time" |
|
|
|
"gorm.io/gorm" |
|
) |
|
|
|
// 首日充值返还 |
|
func (p *Player) ActivityFirstRechargeBack() { |
|
if !call.IsActivityValid(common.ActivityIDFirstRechargeBack) { |
|
return |
|
} |
|
data := call.GetUserFirstRechargeBackData(p.uid) |
|
// 首次充值一天内才计算 |
|
if time.Now().Unix()-data.RechargeTime > common.ActivityFirstRechargeBackTime { |
|
return |
|
} |
|
// 下注-结算=这把输钱 |
|
lost := p.settleData.TotalBet - p.settleData.FinalSettle |
|
db.Mysql().Update(&common.ActivityFirstRechargeBackData{UID: p.uid}, map[string]interface{}{"lost": gorm.Expr("lost + ?", lost)}) |
|
}
|
|
|