互动
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
828 B

5 years ago
  1. package models
  2. import (
  3. "github.com/ouxuanserver/osmanthuswine/src/core"
  4. "time"
  5. )
  6. const RewardWalletTableName = TableNamePrefix + "reward_wallet"
  7. //打赏钱包
  8. type RewardWallet struct {
  9. Id int64 `json:"id"`
  10. CustomerId int64 `json:"customer_id" description:"客户id"`
  11. Balance float64 `json:"balance" description:"余额"`
  12. IsDelete bool `json:"is_delete" xorm:"default(0)"`
  13. CreatedAt time.Time `json:"created_at" xorm:"created" description:"创建时间"`
  14. UpdatedAt time.Time `json:"updated_at" xorm:"updated" description:"更新时间"`
  15. }
  16. func (t *RewardWallet) TableName() string {
  17. return RewardWalletTableName
  18. }
  19. func (t *RewardWallet) IncrBalance(cid int64, money float64) (int64, error) {
  20. return core.GetXormAuto().Where("customer_id=?", cid).Incr("balance", money).Update(t)
  21. }