🎨 完善订单和微信支付功能

This commit is contained in:
2025-07-25 23:02:43 +08:00
parent 8fd1968cf6
commit bb2a68fb61
9 changed files with 572 additions and 41 deletions

View File

@@ -8,12 +8,15 @@ type Order struct {
UserId uint64 `gorm:"column:user_id;type:bigint(20) unsigned;comment:用户ID;NOT NULL" json:"user_id"`
OrderType int `gorm:"column:order_type;type:int(11);comment:订单类型 |1 课程|2 vip|;NOT NULL" json:"order_type"`
ArticleId uint `gorm:"column:article_id;type:bigint(20) unsigned;default:0;comment:文章ID;NOT NULL" json:"article_id"`
Title string `gorm:"column:title;type:varchar(255);comment:订单标题;NOT NULL" json:"title"`
Name string `gorm:"column:name;type:varchar(255);comment:名称;NOT NULL" json:"name"`
Price int64 `gorm:"column:price;type:int(11) unsigned;default:0;comment:订单价格;NOT NULL" json:"price"`
Phone string `gorm:"column:phone;type:varchar(11);comment:手机号;NOT NULL" json:"phone"`
TeacherId uint64 `gorm:"column:teacher_Id;type:bigint(20);comment:教师Id;NOT NULL" json:"teacher_Id"`
Status int `gorm:"column:status;type:int(11);default:1;comment:订单状态 |1 未付款|2 已付款|3 已过期|;NOT NULL" json:"status"`
Desc string `gorm:"column:desc;type:varchar(24);comment:订单描述;NOT NULL" json:"desc"`
OpenId string `gorm:"column:open_id;type:varchar(64);comment:用户OpenId;NOT NULL" json:"open_id"`
PayType int `gorm:"column:pay_type;type:int(11);default:1;comment:支付方式 |1 微信|2 支付宝|3 余额|;NOT NULL" json:"pay_type"`
}
// TableName Order表

View File

@@ -0,0 +1,23 @@
package request
import common "git.echol.cn/loser/lckt/model/common/request"
type BalancePay struct {
UserId uint `json:"user_id" binding:"required"` // 用户ID
OrderNo string `json:"order_no" binding:"required"` // 订单号
OrderId uint `json:"order_id" binding:"required"` // 订单ID
}
type GetOrderList struct {
common.PageInfo
Status int `json:"status" form:"status"` // 订单状态
}
type PayReq struct {
UserId uint64 `json:"user_id"` // 用户ID
OrderId uint `json:"order_id"`
Mode string `json:"mode"` // h5 jsapi
WxCode string `json:"wx_code"`
PayMethod int `json:"pay_method" vd:"$>0; msg:'参数不能为空'"`
OrderNo string `json:"order_no" vd:"@:len($)>0; msg:'订单编号参数不能为空'"`
}