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

5 years ago
5 years ago
  1. package models
  2. import (
  3. "github.com/ouxuanserver/osmanthuswine/src/core"
  4. "time"
  5. )
  6. const BSWalletTableName = TableNamePrefix + "bully_screen_wallet"
  7. type BullyScreenWallet struct {
  8. Id int64 `json:"id"`
  9. CustomerId int64 `json:"customer_id"`
  10. Balance float64 `json:"balance"`
  11. CreatedAt time.Time `json:"created_at"`
  12. UpdatedAt time.Time `json:"updated_at"`
  13. }
  14. func (t *BullyScreenWallet) TableName() string {
  15. return BSWalletTableName
  16. }
  17. func (t *BullyScreenWallet) IncrBalance(cid int64, money float64) (int64, error) {
  18. return core.GetXormAuto().Where("customer_id=?", cid).
  19. Incr("balance", money).Cols("balance").Update(t)
  20. }