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