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

39 lines
2.4 KiB

package models
import (
"time"
"git.ouxuan.net/tommy/osmanthuswine/src/core"
)
const UserRedPackTableName = TableNamePrefix + "user_red_pack"
type UserRedPack struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
MchBillno string `json:"mch_billno" xorm:"not null default('') comment('商户订单号') VARCHAR(28)"`
SendName string `json:"send_name" xorm:"not null default('') comment('商户名称') VARCHAR(32)"`
ReOpenid string `json:"re_openid" xorm:"not null default '' comment('接收红包用户openid') VARCHAR(32)"`
TotalAmount int `json:"total_amount" xorm:"not null default 0 comment('付款金额, 单位分') INT(11)"`
TotalNum int `json:"total_num" xorm:"not null default 0 comment('红包发放总人数') INT(11)"`
SceneId int `json:"scene_id" xorm:"not null default 0 comment('场景id') INT(11)"`
SendListid string `json:"send_listid" xorm:"not null default '' comment('红包订单的微信单号') VARCHAR(32)"`
Status string `json:"status" xorm:"not null default '' comment('红包状态') VARCHAR(16)"`
HbType string `json:"hb_type" xorm:"not null default '' comment('红包类型') VARCHAR(32)"`
Reason string `json:"reason" xorm:"not null default '' comment('失败原因') VARCHAR(32)"`
SendTime string `json:"send_time" xorm:"not null default '' comment('红包发送时间') VARCHAR(32)"`
RefundTime string `json:"refund_time" xorm:"not null default '' comment('红包退款时间') VARCHAR(32)"`
RefundAmount string `json:"refund_amount" xorm:"not null default '' comment('红包退款金额') VARCHAR(32)"`
UserId int `json:"user_id" xorm:"not null default 0 comment('用户id') INT(11)"`
ActivityId int `json:"activity_id" xorm:"not null default 0 comment('互动id') INT(11)"`
IsDelete bool `json:"is_delete" xorm:"not null default(0) comment('是否删除') TINYINT(1)" description:"是否删除"`
CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME" description:"创建时间"`
UpdatedAt time.Time `json:"updated_at" xorm:"not null updated comment('更新时间') DATETIME" description:"更新时间"`
}
func (t *UserRedPack) TableName() string {
return UserRedPackTableName
}
func (t *UserRedPack) AddRedPack() (int64, error) {
return core.GetXormAuto().InsertOne(t)
}