This commit is contained in:
@@ -56,8 +56,8 @@ func (m *customPaymentModel) FindListByPage(ctx context.Context, page, size int,
|
||||
if req.Enable != nil {
|
||||
conn = conn.Where("`enable` = ?", *req.Enable)
|
||||
}
|
||||
if req.Mark != "" {
|
||||
conn = conn.Where("`mark` = ?", req.Mark)
|
||||
if req.Platform != "" {
|
||||
conn = conn.Where("`platform` = ?", req.Platform)
|
||||
}
|
||||
if req.Search != "" {
|
||||
conn = conn.Where("`name` LIKE ?", "%"+req.Search+"%")
|
||||
@@ -72,7 +72,7 @@ func (m *customPaymentModel) FindListByPage(ctx context.Context, page, size int,
|
||||
func (m *customPaymentModel) FindListByPlatform(ctx context.Context, platform string) ([]*Payment, error) {
|
||||
var resp []*Payment
|
||||
err := m.QueryNoCacheCtx(ctx, &resp, func(conn *gorm.DB, v interface{}) error {
|
||||
return conn.Model(&Payment{}).Where("mark = ?", platform).Find(v).Error
|
||||
return conn.Model(&Payment{}).Where("platform = ?", platform).Find(v).Error
|
||||
})
|
||||
return resp, err
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ func (l *Payment) BeforeDelete(_ *gorm.DB) (err error) {
|
||||
}
|
||||
|
||||
type Filter struct {
|
||||
Mark string
|
||||
Enable *bool
|
||||
Search string
|
||||
Platform string
|
||||
Enable *bool
|
||||
Search string
|
||||
}
|
||||
|
||||
type StripeConfig struct {
|
||||
|
||||
Reference in New Issue
Block a user