1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package shanghu
- import (
- orm "duoduo/database"
- "github.com/shopspring/decimal"
- "time"
- )
- type MerchantRechargeClientAccountLog struct {
- ID int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"` // 主键
- AmountPre decimal.Decimal `gorm:"column:amount_pre;type:decimal(10,2)" json:"amount_pre"` // 交易前
- AmountAfter decimal.Decimal `gorm:"column:amount_after;type:decimal(10,2)" json:"amount_after"` // 交易后
- TransType int `gorm:"column:trans_type;type:int(11)" json:"trans_type"` // 交易类型 1-充值 2-消费
- MerchantOpenID string `gorm:"column:merchant_open_id;type:varchar(255)" json:"merchant_open_id"` // 操作人员
- ClientOpenID string `gorm:"column:client_open_id;type:varchar(255)" json:"client_open_id"` // 商户openid
- 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"` // 删除时间
- Amount decimal.Decimal `gorm:"column:amount;type:decimal(10,2)" json:"amount"` // 交易金额
- PayTransID int64 `gorm:"column:pay_trans_id;type:bigint(20)" json:"pay_trans_id"` // 充值id
- Operator string `gorm:"column:operator;type:varchar(255)" json:"operator"` // operator 操作人
- }
- func (m *MerchantRechargeClientAccountLog) TableName() string {
- return "merchant_recharge_client_account_log"
- }
- func (u *MerchantRechargeClientAccountLog) Create() (MerchantRechargeClientAccountLog, error) {
- var doc MerchantRechargeClientAccountLog
- var err error
- doc = *u
- err = orm.ShMysql.Table(u.TableName()).Create(&doc).Error
- if err != nil {
- return doc, err
- }
- return doc, nil
- }
|