model

package
v0.0.0-...-bb91008 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2024 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrder

func CreateOrder(svc *svc.ServiceContext, order *Order, orderAddress *OrderAddress, items []OrderItem) error

func CreateRefundRecords

func CreateRefundRecords(svc *svc.ServiceContext, info *RefundRecords) error

func DeletedRefundByRefundSn

func DeletedRefundByRefundSn(svc *svc.ServiceContext, refundSn string) error

func GetOrderStatusBySn

func GetOrderStatusBySn(svc *svc.ServiceContext, Sn string) (status int32, err error)

func RollbackCreateOrder

func RollbackCreateOrder(svc *svc.ServiceContext, orderId int64, sn string) error

func UpdateOrderBySn

func UpdateOrderBySn(svc *svc.ServiceContext, order Order) error

Types

type Order

type Order struct {
	gorm.Model
	UserId          int64     `json:"user_id"           gorm:"type:int(11);not null;comment:用户id"`
	CouponId        int64     `json:"coupon_id"         gorm:"type:int(11);index;default:0;comment:优惠券id"`
	Sn              string    `json:"sn"                gorm:"type:char(36);unique;not null;comment:订单编号"`
	Amount          string    `json:"amount"            gorm:"type:decimal(10,2);comment:订单总金额"`
	DiscountAmount  string    `json:"discount_amount"   gorm:"type:decimal(10,2);comment:订单折扣金额"`
	PaidAmount      string    `json:"paid_amount"       gorm:"type:decimal(10,2);comment:订单实付金额"`
	PayType         int32     `json:"pay_type"          gorm:"Type:tinyint(1);default:1;comment: 1支付宝 2微信"`
	PayTime         time.Time `json:"pay_time"          gorm:"type:datetime;comment:支付时间"`
	Status          int32     `` /* 153-byte string literal not displayed */
	Address         string    `json:"address"           gorm:"type:varchar(255);comment:收货地址"`
	IsEstimation    bool      `json:"is_estimation"     gorm:"type:tinyint(1);default:0;comment: 0未评价 1已评价"`
	RefundableOrNot int32     `json:"refundable_or_not" gorm:"type:tinyint(1);default:1;comment: 1未申请退款 2以申请退款 3退款驳回"`
	OrderType       int32     `json:"order_type"        gorm:"type:tinyint(1);index;default:0;comment: 0普通订单 1秒杀订单"`
}

func GetOrderByOrderId

func GetOrderByOrderId(svc *svc.ServiceContext, orderId int64) (order Order, err error)

func GetOrderBySn

func GetOrderBySn(svc *svc.ServiceContext, Sn string) (order Order, err error)

func GetOrdersByStatus

func GetOrdersByStatus(svc *svc.ServiceContext, userId, status, page, pageSize int64, isEstimation, isAll bool) (orders []Order, err error)

type OrderAddress

type OrderAddress struct {
	gorm.Model
	OrderId  int64  `json:"order_id" gorm:"type:int(10);index;comment:订单id"`
	OrderSn  string `json:"order_sn" gorm:"type:char(36);comment:订单编号"`
	Mobile   string `json:"mobile"   gorm:"type:char(255);comment:手机号"`
	Nickname string `json:"nickname" gorm:"type:varchar(255);comment:收件人昵称"`
	Address  string `json:"address"  gorm:"type:varchar(255);comment:收货地址"`
}

func GetOrderAddress

func GetOrderAddress(svc *svc.ServiceContext, orderId int64) (orderAddress *OrderAddress, err error)

type OrderItem

type OrderItem struct {
	gorm.Model
	OrderId    int64  `json:"order_id"    gorm:"type:int(11);not null;comment:订单id"`
	OrderSn    string `json:"order_sn"    gorm:"type:char(36);comment:订单编号"`
	GoodsId    int64  `json:"goods_id"    gorm:"type:int(11);index;not null;comment:商品id"`
	Quantity   int64  `json:"quantity"    gorm:"type:int(11);comment:购买商品数量"`
	GoodsTitle string `json:"goods_title" gorm:"type:varchar(255);comment:商品名称"`
	GoodsPrice string `json:"goods_price" gorm:"type:decimal(10,2);comment:商品价格"`
	Img        string `json:"img"         gorm:"type:varchar(255);comment:商品图片"`
}

func GetOrderItem

func GetOrderItem(svc *svc.ServiceContext, orderId int64) (items []OrderItem, err error)

func GetOrderItems

func GetOrderItems(svc *svc.ServiceContext, orderIds []uint) (items []OrderItem, err error)

type RefundRecords

type RefundRecords struct {
	gorm.Model
	OrderID         int64          `json:"order_id"          gorm:"type:int(11);index;comment:订单id"`
	UserId          int64          `json:"user_id"           gorm:"type:int(11);index;comment:用户id"`
	OrderSn         string         `json:"order_sn"          gorm:"type:char(36);comment:订单编号"`
	RefundAmount    string         `json:"refund_amount"     gorm:"type:decimal(11,2);comment:退款金额"`
	RefundSn        string         `json:"refund_sn"         gorm:"type:char(36);unique;not null;comment:退款编号"`
	RefundReason    string         `json:"refund_reason"     gorm:"type:varchar(255);comment:退款原因"`
	RefundImageUrls datatypes.JSON `json:"refund_image_urls" gorm:"type:json;comment:退款图片"`
	RefundStatus    int32          `json:"refund_status"     gorm:"type:tinyint(1);default:0;comment: 0审核中 1处理中 2已完成 3已拒绝"`
}

func GetRefundRecordByRefundId

func GetRefundRecordByRefundId(svc *svc.ServiceContext, RefundId int64) (
	refundRecords RefundRecords, err error)

func GetRefundRecords

func GetRefundRecords(svc *svc.ServiceContext, UserId, Page, PageSize int64) (
	refundRecords []RefundRecords, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL