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.
26 lines
643 B
26 lines
643 B
|
1 year ago
|
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)})
|
||
|
|
}
|