feat(tenant): 隔离客服通知文件与后台任务

This commit is contained in:
yml
2026-11-15 16:23:28 +08:00
parent c7dacfa025
commit e994fd9166
52 changed files with 1670 additions and 254 deletions
+7 -1
View File
@@ -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
}