🎨 新增讲师包月功能,优化支付回调
This commit is contained in:
@@ -4,20 +4,21 @@ import "git.echol.cn/loser/lckt/global"
|
||||
|
||||
type Order struct {
|
||||
global.GVA_MODEL
|
||||
OrderNo string `gorm:"column:order_no;type:varchar(24);comment:订单编号;NOT NULL" json:"order_no"`
|
||||
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"`
|
||||
VipId uint `gorm:"column:vip_id;type:bigint(20) unsigned;default:0;comment:会员ID;NOT NULL" json:"vip_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"`
|
||||
OrderNo string `gorm:"column:order_no;type:varchar(24);comment:订单编号;NOT NULL" json:"order_no"`
|
||||
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|3 讲师包月;NOT NULL" json:"order_type"`
|
||||
ArticleId uint `gorm:"column:article_id;type:bigint(20) unsigned;default:0;comment:文章ID;NOT NULL" json:"article_id"`
|
||||
VipId uint `gorm:"column:vip_id;type:bigint(20) unsigned;default:0;comment:会员ID;NOT NULL" json:"vip_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"`
|
||||
TeacherVipId string `gorm:"column:teacher_vip_id;unsigned;comment:讲师VIP ID;NOT NULL" json:"teacher_vip_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表
|
||||
|
||||
8
model/app/request/user.go
Normal file
8
model/app/request/user.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package request
|
||||
|
||||
import common "git.echol.cn/loser/lckt/model/common/request"
|
||||
|
||||
type GetTeacherVipList struct {
|
||||
common.PageInfo
|
||||
TeacherId uint `json:"teacher_id" form:"teacher_id"` // 讲师ID
|
||||
}
|
||||
16
model/app/teacher_vip.go
Normal file
16
model/app/teacher_vip.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package app
|
||||
|
||||
import "git.echol.cn/loser/lckt/global"
|
||||
|
||||
type TeacherVip struct {
|
||||
global.GVA_MODEL
|
||||
Title string `json:"title" form:"title" gorm:"comment:VIP标题;size:128"`
|
||||
TeacherId uint `json:"teacher_id" gorm:"comment:讲师ID;"`
|
||||
TeacherName string `json:"teacher_name" gorm:"comment:讲师名称"` // 讲师名称
|
||||
Price int `json:"price" gorm:"comment:VIP价格(单位为分)"`
|
||||
Desc string `json:"desc" gorm:"comment:VIP描述;type:longtext"`
|
||||
}
|
||||
|
||||
func (TeacherVip) TableName() string {
|
||||
return "app_teacher_vip"
|
||||
}
|
||||
17
model/app/user_teacher_vip.go
Normal file
17
model/app/user_teacher_vip.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package app
|
||||
|
||||
import "git.echol.cn/loser/lckt/global"
|
||||
|
||||
type UserTeacherVip struct {
|
||||
global.GVA_MODEL
|
||||
UserId uint `gorm:"column:user_id;comment:用户ID;NOT NULL" json:"user_id"`
|
||||
TeacherId uint `gorm:"column:teacher_id;comment:讲师ID;NOT NULL" json:"teacher_id"`
|
||||
TeacherVipId uint `gorm:"column:teacher_vip_id;comment:讲师VIP ID;NOT NULL" json:"teacher_vip_id"`
|
||||
ExpireAt string `gorm:"column:expire_at;comment:到期时间;NOT NULL" json:"expire_at"`
|
||||
//是否过期
|
||||
IsExpire int `gorm:"column:is_expire;type:int(11);default:1;comment:是否过期 |1 未过期|2 已过期;NOT NULL" json:"is_expire"`
|
||||
}
|
||||
|
||||
func (UserTeacherVip) TableName() string {
|
||||
return "user_teacher_vip"
|
||||
}
|
||||
Reference in New Issue
Block a user