互动
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.

29 lines
1.3 KiB

5 years ago
  1. package models
  2. import (
  3. "github.com/ouxuanserver/osmanthuswine/src/core"
  4. "time"
  5. )
  6. const AuctionPlayerTableName = TableNamePrefix + "auction_player"
  7. //竞拍者
  8. type AuctionPlayer struct {
  9. Id int64 `json:"id" xorm:"not null pk autoincr INT(11)"`
  10. AuctionActivityId int64 `json:"auction_activity_id" xorm:"not null comment('竞拍活动id') INT(11)"`
  11. UserId int64 `json:"user_id" xorm:"not null comment('客户的id') INT(11)"`
  12. RehearsalId int64 `json:"rehearsal_id" xorm:"not null default(0) comment('彩排id, 0正式数据') INT(11)"`
  13. Code int64 `json:"code" xorm:"not null comment('竞拍参与人的代号') INT(11)"`
  14. IsDelete bool `json:"is_delete" xorm:"not null default(0) comment('软删除') TINYINT(0)"`
  15. CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME"`
  16. UpdatedAt time.Time `json:"updated_at" xorm:"not null updated comment('更新时间') DATETIME"`
  17. }
  18. func (t *AuctionPlayer) TableName() string {
  19. return AuctionPlayerTableName
  20. }
  21. func (t *AuctionPlayer) GetByAuctionIdAndUid(aid, uid, rid int64) (bool, error) {
  22. return core.GetXormAuto().Where("is_delete=0 and auction_activity_id=? and user_id=? and rehearsal_id=?",
  23. aid, uid, rid).Get(t)
  24. }