43 lines
1.0 KiB
Go
43 lines
1.0 KiB
Go
package orderthirdpaylogmodel
|
||
|
||
import (
|
||
"github.com/qit-team/snow-core/db"
|
||
"sync"
|
||
"time"
|
||
)
|
||
|
||
var (
|
||
once sync.Once
|
||
m *OrderThirdPayLogModel
|
||
)
|
||
|
||
// 实体
|
||
type OrderThirdPayLog struct {
|
||
Id int64 `xorm:"'id' bigint(20) pk autoincr"`
|
||
OrderId int64 `xorm:"'order_id' bigint(20)"`
|
||
PayCallback string `xorm:"'pay_callback' varchar(255)"`
|
||
Status int `xorm:"'status' TINYINT"`
|
||
MerchantParam string `xorm:"'merchant_param' varchar(255)"`
|
||
MerchantCallback string `xorm:"'merchant_callback' varchar(255)"`
|
||
CreateTime time.Time `xorm:"'create_time' datetime"`
|
||
}
|
||
|
||
// 表名
|
||
func (m *OrderThirdPayLog) TableName() string {
|
||
return "order_third_pay_log"
|
||
}
|
||
|
||
// 私有化,防止被外部new
|
||
type OrderThirdPayLogModel struct {
|
||
db.Model //组合基础Model,集成基础Model的属性和方法
|
||
}
|
||
|
||
// 单例模式
|
||
func GetInstance() *OrderThirdPayLogModel {
|
||
once.Do(func() {
|
||
m = new(OrderThirdPayLogModel)
|
||
//m.DiName = "" //设置数据库实例连接,默认db.SingletonMain
|
||
})
|
||
return m
|
||
}
|