123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package models
- import (
- "time"
- "shopperthree_manage_v2/client/mysql"
- )
- // 删除标志
- const (
- StatusNormal = 0
- StatusDelete = 1
- )
- // 审核状态
- const (
- VerifyPending = 0
- VerifyPassed = 1
- VerifyRejected = 2
- )
- //订单sku
- const (
- OrderSkuSuccess = 0 // 下单成功
- OrderSkuPay = 1 // 已支付,即发货中
- OrderSkuPackSuccess = 2 // 发货成功
- OrderSkuChange = 3 // 退换货
- OrderSkuRefund = 4 // 退货退款
- OrderSkuCancel = 5 // 取消下单
- )
- type CommonField struct {
- Id int `gorm:"primary_key;column:id"`
- CreatedAt time.Time `json:"created_at" gorm:"column:created_at;type:datetime;NOT NULL;index:idx_created_at;DEFAULT:CURRENT_TIMESTAMP"` // 创建时间
- UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;type:datetime;NOT NULL;index:idx_updated_at;DEFAULT:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0)"` // 最后更新时间
- Status uint8 `json:"status" gorm:"column:status;NOT NULL;index:idx_status;default:0"` // 删除标记,1:normal, 0: delete
- }
- func GetShortUUID() string {
- db := mysql.Client.Master()
- var uuid string
- db.Unscoped().Raw("SELECT UUID_SHORT()").Row().Scan(&uuid)
- return uuid
- }
|