代码拉取完成,页面将自动刷新
package models
import (
"time"
"github.com/astaxie/beego/orm"
)
//金币变更日志
type CoinLog struct {
Id int `orm:"column(Id)"`
Uid int `orm:"column(Uid);index"` //用户id
Coin int `orm:"column(Coin);default(0)"` //金币变更,正表示加,负表示减
Log string `orm:"column(Log);size(512);default()"` //记录说明
TimeCreate int `orm:"column(TimeCreate)"` //记录变更时间
}
func NewCoinLog() *CoinLog {
return &CoinLog{}
}
func GetTableCoinLog() string {
return getTable("coin_log")
}
//记录金币记录变更情况,会自动对用户的金币做变更
//@param log 日志对象
//@return err 错误,nil表示true,否则表示false
func (this *CoinLog) LogRecord(log CoinLog) (err error) {
log.TimeCreate = int(time.Now().Unix())
_, err = orm.NewOrm().Insert(&log)
return
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。