fix
This commit is contained in:
26
model/gmodel/fs_pay_gen.go
Normal file
26
model/gmodel/fs_pay_gen.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type FsPay struct {
|
||||
Id int64 `gorm:"primary_key" json:"id"` //
|
||||
UserId *int64 `gorm:"" json:"user_id"` // 用户id
|
||||
OrderNumber *string `gorm:"" json:"order_number"` // 订单编号
|
||||
TradeNo *string `gorm:"" json:"trade_no"` // 第三方支付编号
|
||||
PayAmount *int64 `gorm:"" json:"pay_amount"` // 支付金额 (分)
|
||||
PayStatus *int64 `gorm:"" json:"pay_status"` // 支付状态 0 不成功 1 成功
|
||||
IsRefund *int64 `gorm:"" json:"is_refund"` // 是否退款 0 未退款 1退款
|
||||
PaymentMethod *int64 `gorm:"" json:"payment_method"` // 支付方式 1 stripe 2 paypal
|
||||
PayStage *int64 `gorm:"" json:"pay_stage"` // 支付阶段 1首付 2尾款
|
||||
OrderSource *int64 `gorm:"" json:"order_source"` // 订单来源 1pc
|
||||
PayTime *int64 `gorm:"" json:"pay_time"` // 支付时间
|
||||
CreatedAt *int64 `gorm:"" json:"created_at"` // 创建时间
|
||||
UpdatedAt *int64 `gorm:"" json:"updated_at"` // 更新时间
|
||||
CardNo *string `gorm:"" json:"card_no"` // 卡后4位
|
||||
Brand *string `gorm:"" json:"brand"` // 银行品牌
|
||||
}
|
||||
type FsPayModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsPayModel(db *gorm.DB) *FsPayModel { return &FsPayModel{db} }
|
||||
11
model/gmodel/fs_pay_logic.go
Normal file
11
model/gmodel/fs_pay_logic.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package gmodel
|
||||
|
||||
import "context"
|
||||
|
||||
func (p *FsPayModel) GetListByOrderNumber(ctx context.Context, sn string) (resp []FsPay, err error) {
|
||||
err = p.db.WithContext(ctx).Model(&FsPay{}).Where("`order_number` = ? ", sn).Find(&resp).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
26
model/gmodel_gen/fs_pay_gen.go
Normal file
26
model/gmodel_gen/fs_pay_gen.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type FsPay struct {
|
||||
Id int64 `gorm:"primary_key" json:"id"` //
|
||||
UserId *int64 `gorm:"" json:"user_id"` // 用户id
|
||||
OrderNumber *string `gorm:"" json:"order_number"` // 订单编号
|
||||
TradeNo *string `gorm:"" json:"trade_no"` // 第三方支付编号
|
||||
PayAmount *int64 `gorm:"" json:"pay_amount"` // 支付金额 (分)
|
||||
PayStatus *int64 `gorm:"" json:"pay_status"` // 支付状态 0 不成功 1 成功
|
||||
IsRefund *int64 `gorm:"" json:"is_refund"` // 是否退款 0 未退款 1退款
|
||||
PaymentMethod *int64 `gorm:"" json:"payment_method"` // 支付方式 1 stripe 2 paypal
|
||||
PayStage *int64 `gorm:"" json:"pay_stage"` // 支付阶段 1首付 2尾款
|
||||
OrderSource *int64 `gorm:"" json:"order_source"` // 订单来源 1pc
|
||||
PayTime *int64 `gorm:"" json:"pay_time"` // 支付时间
|
||||
CreatedAt *int64 `gorm:"" json:"created_at"` // 创建时间
|
||||
UpdatedAt *int64 `gorm:"" json:"updated_at"` // 更新时间
|
||||
CardNo *string `gorm:"" json:"card_no"` // 卡后4位
|
||||
Brand *string `gorm:"" json:"brand"` // 银行品牌
|
||||
}
|
||||
type FsPayModel struct{ db *gorm.DB }
|
||||
|
||||
func NewFsPayModel(db *gorm.DB) *FsPayModel { return &FsPayModel{db} }
|
||||
2
model/gmodel_gen/fs_pay_logic.go
Normal file
2
model/gmodel_gen/fs_pay_logic.go
Normal file
@@ -0,0 +1,2 @@
|
||||
package model
|
||||
// TODO: 使用model的属性做你想做的
|
||||
Reference in New Issue
Block a user