setting changed 2

This commit is contained in:
2026-06-05 17:43:02 +03:30
parent 7776abf6a3
commit c082e5eb42
8 changed files with 152 additions and 234 deletions
+6 -5
View File
@@ -8,7 +8,7 @@ use App\Models\Setting;
class ConfigService
{
public const PRICE_PROVIDERS = ['montzar', 'etehadie', 'taban_gohar', 'main_product', 'zaarbox'];
public const PRICE_PROVIDERS = ['montzar', 'taban_gohar', 'main_product', 'zaarbox'];
public function Config($name)
{
@@ -22,7 +22,7 @@ class ConfigService
{
$row = Setting::where('key', $key)->first();
if ($row !== null && $row->value !== null && $row->value !== '') {
if ($row !== null && $row->is_active && $row->value !== null && $row->value !== '') {
return $row->value;
}
@@ -91,7 +91,7 @@ class ConfigService
}
/**
* تنها منبع فعال قیمت — فقط یکی از: montzar | etehadie | taban_gohar | main_product
* تنها منبع فعال قیمت — montzar | taban_gohar | main_product | zaarbox
*
* اولویت:
* 1) price_provider (یا price_primary_source قدیمی)
@@ -156,7 +156,7 @@ class ConfigService
{
$provider = $this->priceProvider();
return in_array($provider, ['montzar', 'etehadie'], true) ? $provider : 'montzar';
return in_array($provider, ['montzar'], true) ? $provider : 'montzar';
}
public function usesMontzarPricing(): bool
@@ -164,9 +164,10 @@ class ConfigService
return $this->priceProvider() === 'montzar';
}
/** @deprecated منبع etehadie حذف شده */
public function usesEtehadiePricing(): bool
{
return $this->priceProvider() === 'etehadie';
return false;
}
public function usesMainProductPricing(): bool