添加优惠券功能,实现价格计算
This commit is contained in:
@@ -25,6 +25,7 @@ var (
|
||||
Channel *channel
|
||||
Client *client
|
||||
ClientPermissionLink *clientPermissionLink
|
||||
Coupon *coupon
|
||||
Node *node
|
||||
Permission *permission
|
||||
Product *product
|
||||
@@ -52,6 +53,7 @@ func SetDefault(db *gorm.DB, opts ...gen.DOOption) {
|
||||
Channel = &Q.Channel
|
||||
Client = &Q.Client
|
||||
ClientPermissionLink = &Q.ClientPermissionLink
|
||||
Coupon = &Q.Coupon
|
||||
Node = &Q.Node
|
||||
Permission = &Q.Permission
|
||||
Product = &Q.Product
|
||||
@@ -80,6 +82,7 @@ func Use(db *gorm.DB, opts ...gen.DOOption) *Query {
|
||||
Channel: newChannel(db, opts...),
|
||||
Client: newClient(db, opts...),
|
||||
ClientPermissionLink: newClientPermissionLink(db, opts...),
|
||||
Coupon: newCoupon(db, opts...),
|
||||
Node: newNode(db, opts...),
|
||||
Permission: newPermission(db, opts...),
|
||||
Product: newProduct(db, opts...),
|
||||
@@ -109,6 +112,7 @@ type Query struct {
|
||||
Channel channel
|
||||
Client client
|
||||
ClientPermissionLink clientPermissionLink
|
||||
Coupon coupon
|
||||
Node node
|
||||
Permission permission
|
||||
Product product
|
||||
@@ -139,6 +143,7 @@ func (q *Query) clone(db *gorm.DB) *Query {
|
||||
Channel: q.Channel.clone(db),
|
||||
Client: q.Client.clone(db),
|
||||
ClientPermissionLink: q.ClientPermissionLink.clone(db),
|
||||
Coupon: q.Coupon.clone(db),
|
||||
Node: q.Node.clone(db),
|
||||
Permission: q.Permission.clone(db),
|
||||
Product: q.Product.clone(db),
|
||||
@@ -176,6 +181,7 @@ func (q *Query) ReplaceDB(db *gorm.DB) *Query {
|
||||
Channel: q.Channel.replaceDB(db),
|
||||
Client: q.Client.replaceDB(db),
|
||||
ClientPermissionLink: q.ClientPermissionLink.replaceDB(db),
|
||||
Coupon: q.Coupon.replaceDB(db),
|
||||
Node: q.Node.replaceDB(db),
|
||||
Permission: q.Permission.replaceDB(db),
|
||||
Product: q.Product.replaceDB(db),
|
||||
@@ -203,6 +209,7 @@ type queryCtx struct {
|
||||
Channel *channelDo
|
||||
Client *clientDo
|
||||
ClientPermissionLink *clientPermissionLinkDo
|
||||
Coupon *couponDo
|
||||
Node *nodeDo
|
||||
Permission *permissionDo
|
||||
Product *productDo
|
||||
@@ -230,6 +237,7 @@ func (q *Query) WithContext(ctx context.Context) *queryCtx {
|
||||
Channel: q.Channel.WithContext(ctx),
|
||||
Client: q.Client.WithContext(ctx),
|
||||
ClientPermissionLink: q.ClientPermissionLink.WithContext(ctx),
|
||||
Coupon: q.Coupon.WithContext(ctx),
|
||||
Node: q.Node.WithContext(ctx),
|
||||
Permission: q.Permission.WithContext(ctx),
|
||||
Product: q.Product.WithContext(ctx),
|
||||
|
||||
Reference in New Issue
Block a user