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

30 lines
1.5 KiB

5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
5 years ago
  1. package models
  2. import (
  3. "time"
  4. "git.ouxuan.net/tommy/osmanthuswine/src/core"
  5. )
  6. const ShakeRedEnvelopeUserTableName = TableNamePrefix + "shake_red_envelope_user"
  7. type ShakeRedEnvelopeUser struct {
  8. Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
  9. RehearsalId int `json:"rehearsal_id" xorm:"not null default(0) comment('彩排id/0正式') INT(11)"`
  10. ArchId int `json:"arch_id" xorm:"not null default 0 comment('归档id') INT(11)"`
  11. ShakeRedEnvelopeActivityId int `json:"shake_red_envelope_activity_id" xrom:"not null comment('摇红包活动id') INT(11)"`
  12. ShakeRedEnvelopeRuleId int `json:"shake_red_envelope_rule_id" xorm:"not null comment('轮次id') INT(11)"`
  13. UserId int `json:"user_id" xorm:"not null comment('用户id') INT(11)"`
  14. IsDelete int `json:"is_delete" xorm:"not null default(0) comment('软删除') TINYINT(1)"`
  15. CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间')"`
  16. UpdateAt time.Time `json:"update_at" xorm:"not null updated comment('更新时间')"`
  17. }
  18. func (t *ShakeRedEnvelopeUser) TableName() string {
  19. return ShakeRedEnvelopeUserTableName
  20. }
  21. func (t *ShakeRedEnvelopeUser) Exist(userId, ruleId, archId, rehearsalId interface{}) (bool, error) {
  22. return core.GetXormAuto().Where("is_delete=0 and user_id=? and shake_red_envelope_rule_id=? and "+
  23. " arch_id=? and rehearsal_id=?", userId, ruleId, archId, rehearsalId).Exist(t)
  24. }