order_log.go
911 字节
package models
import (
"context"
"time"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"
)
//OrderLog 订单修改记录
type OrderLog struct {
tableName struct{} `pg:"order_log"`
Id int64
OrderId int64 `` //订单id
AlterTime time.Time `` //时间
Operator string `` //操作人员
OperatorId int64 `` //操作人员Id
OperatorType string `` //操作人员的类型
LogAction string `` //执行动作
Descript []domain.OrderLogDescript `` //描述日志内容
DataFrom string `` //修改操作的来源:"web_admin"
}
var _ pg.BeforeInsertHook = (*OrderBase)(nil)
func (l *OrderLog) BeforeInsert(ctx context.Context) (context.Context, error) {
l.AlterTime = time.Now()
return ctx, nil
}