feat(tenant): 隔离客服通知文件与后台任务
This commit is contained in:
@@ -440,7 +440,13 @@ func (r *Repository) FindForUser(ctx context.Context, userID uint64, orderID uin
|
||||
|
||||
func pendingPaymentTimeoutMinutes(tx *gorm.DB) int {
|
||||
var row model.SystemConfig
|
||||
err := tx.Where("`key` = ?", "order.pending_payment_timeout_minutes").First(&row).Error
|
||||
query := tx.Where("`key` = ?", "order.pending_payment_timeout_minutes")
|
||||
if tx.Statement != nil && tx.Statement.Context != nil {
|
||||
if tenantID := tenancy.IDFromContext(tx.Statement.Context); tenantID > 0 {
|
||||
query = query.Where("tenant_id = ?", tenantID)
|
||||
}
|
||||
}
|
||||
err := query.First(&row).Error
|
||||
if err != nil {
|
||||
return defaultPendingPaymentTimeoutMinutes
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user