1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package shanghu
- //import (
- // orm "duoduo/database"
- // "time"
- //)
- //
- //type ClientActiveDrawLog struct {
- // ID int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
- // ActiveConfigID int64 `gorm:"column:active_config_id;type:bigint(20)" json:"active_config_id"` // 活动抽奖id
- // ClientOpenID string `gorm:"column:client_open_id;type:varchar(255)" json:"client_open_id"`
- // DrawProductID int64 `gorm:"column:draw_product_id;type:bigint(20)" json:"draw_product_id"` // 中奖商品
- // CreateBy int64 `gorm:"column:create_by;type:bigint(20)" json:"create_by"` // 创建者
- // UpdateBy int64 `gorm:"column:update_by;type:bigint(20)" json:"update_by"` // 更新者
- // CreatedAt time.Time `gorm:"column:created_at;type:datetime(3)" json:"created_at"` // 创建时间
- // UpdatedAt time.Time `gorm:"column:updated_at;type:datetime(3)" json:"updated_at"` // 最后更新时间
- // DeletedAt time.Time `gorm:"column:deleted_at;type:datetime(3);default:null" json:"deleted_at"` // 删除时间
- // IsPrize int `gorm:"column:is_prize;type:int(11)" json:"is_prize"` // 1-未中奖 2-未兑奖 3-已兑奖
- //}
- //
- //func (m *ClientActiveDrawLog) TableName() string {
- // return "client_active_draw_log"
- //}
- //
- //func (m *ClientActiveDrawLog) GetClientActiveDrawLogByBiZHong() (int64, error) {
- // var count int64
- //
- // table := orm.ShMysql.Table(m.TableName())
- // table = table.Where("active_config_id = ? and client_open_id = ? and draw_product_id = ? ",
- // m.ActiveConfigID, m.ClientOpenID, m.DrawProductID)
- // if err := table.Count(&count).Error; err != nil {
- // return 0, nil
- // }
- // return count, nil
- //
- //}
- //
- //func (m *ClientActiveDrawLog) Create() (ClientActiveDrawLog, error) {
- // var doc ClientActiveDrawLog
- // var err error
- //
- // doc = *m
- // err = orm.ShMysql.Table(m.TableName()).Create(&doc).Error
- // if err != nil {
- // return doc, err
- // }
- //
- // return doc, nil
- //}
- //func (m *ClientActiveDrawLog) CreateClientActiveDraw()error {
- //
- //}
|