active.draw.config.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package shanghu
  2. //import (
  3. // orm "duoduo/database"
  4. // "time"
  5. //)
  6. //
  7. //type ClientActiveDrawLog struct {
  8. // ID int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
  9. // ActiveConfigID int64 `gorm:"column:active_config_id;type:bigint(20)" json:"active_config_id"` // 活动抽奖id
  10. // ClientOpenID string `gorm:"column:client_open_id;type:varchar(255)" json:"client_open_id"`
  11. // DrawProductID int64 `gorm:"column:draw_product_id;type:bigint(20)" json:"draw_product_id"` // 中奖商品
  12. // CreateBy int64 `gorm:"column:create_by;type:bigint(20)" json:"create_by"` // 创建者
  13. // UpdateBy int64 `gorm:"column:update_by;type:bigint(20)" json:"update_by"` // 更新者
  14. // CreatedAt time.Time `gorm:"column:created_at;type:datetime(3)" json:"created_at"` // 创建时间
  15. // UpdatedAt time.Time `gorm:"column:updated_at;type:datetime(3)" json:"updated_at"` // 最后更新时间
  16. // DeletedAt time.Time `gorm:"column:deleted_at;type:datetime(3);default:null" json:"deleted_at"` // 删除时间
  17. // IsPrize int `gorm:"column:is_prize;type:int(11)" json:"is_prize"` // 1-未中奖 2-未兑奖 3-已兑奖
  18. //}
  19. //
  20. //func (m *ClientActiveDrawLog) TableName() string {
  21. // return "client_active_draw_log"
  22. //}
  23. //
  24. //func (m *ClientActiveDrawLog) GetClientActiveDrawLogByBiZHong() (int64, error) {
  25. // var count int64
  26. //
  27. // table := orm.ShMysql.Table(m.TableName())
  28. // table = table.Where("active_config_id = ? and client_open_id = ? and draw_product_id = ? ",
  29. // m.ActiveConfigID, m.ClientOpenID, m.DrawProductID)
  30. // if err := table.Count(&count).Error; err != nil {
  31. // return 0, nil
  32. // }
  33. // return count, nil
  34. //
  35. //}
  36. //
  37. //func (m *ClientActiveDrawLog) Create() (ClientActiveDrawLog, error) {
  38. // var doc ClientActiveDrawLog
  39. // var err error
  40. //
  41. // doc = *m
  42. // err = orm.ShMysql.Table(m.TableName()).Create(&doc).Error
  43. // if err != nil {
  44. // return doc, err
  45. // }
  46. //
  47. // return doc, nil
  48. //}
  49. //func (m *ClientActiveDrawLog) CreateClientActiveDraw()error {
  50. //
  51. //}