// Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. package model import ( "github.com/shopspring/decimal" "go_zh/config" "time" ) const TableNameXShopOrder = "x_shop_orders" // XShopOrder mapped from table type XShopOrder struct { ID int `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` ShopID int `gorm:"column:shop_id;not null;comment:店铺ID" json:"shop_id"` // 店铺ID MID int `gorm:"column:m_id;not null;comment:会员ID" json:"m_id"` // 会员ID RsSn string `gorm:"column:rs_sn;not null;comment:店铺订单支付编号" json:"rs_sn"` // 店铺订单支付编号 PaySn string `gorm:"column:pay_sn;not null;comment:支付编号" json:"pay_sn"` // 支付编号 PayType int `gorm:"column:pay_type;not null;comment:支付类型,1:微信,2:支付宝" json:"pay_type"` // 支付类型,1:微信,2:支付宝 PayMoney decimal.Decimal `gorm:"column:pay_money;not null;comment:支付金额" json:"pay_money"` // 支付金额 Status int `gorm:"column:status;not null;comment:1:待支付,2:已支付,3:已退款,已完成" json:"status"` // 1:待支付,2:已支付,3:已退款,已完成 CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` Discount decimal.Decimal `gorm:"column:discount;default:0.00;comment:折扣金额" json:"discount"` // 折扣金额 IsClearing int `gorm:"column:is_clearing;comment:是否清分 0:待清分,1:已清分" json:"is_clearing"` // 是否清分 0:待清分,1:已清分 ServiceMoney decimal.Decimal `gorm:"column:service_money;not null;default:0.00;comment:平台手续费" json:"service_money"` // 平台手续费 DiscountMoney decimal.Decimal `gorm:"column:discount_money;not null;default:0.00;comment:让利金额" json:"discount_money"` // 让利金额 EarningsMoney decimal.Decimal `gorm:"column:earnings_money;not null;default:0.00;comment:收益金额" json:"earnings_money"` // 收益金额 ReturnSn string `gorm:"column:return_sn;comment:退款订单编号" json:"return_sn"` // 退款订单编号 IsReport int `gorm:"column:is_report;comment:是否播报" json:"is_report"` // 是否播报 PayCodeSource int `gorm:"column:pay_code_source;default:1;comment:支付收款码来源 1普通收款码 2烟草收款码" json:"pay_code_source"` // 支付收款码来源 1普通收款码 2烟草收款码 IsBank int `gorm:"column:is_bank;comment:是否银联支付 0否1是" json:"is_bank"` // 是否银联支付 0否1是 } // TableName XShopOrder's table name func (*XShopOrder) TableName() string { return TableNameXShopOrder } //新增订单 func (so *XShopOrder) CreateShopOrder() error { err := config.Mdb.Model(&so).Create(&so).Error return err }