diff --git a/app/Http/Controllers/Customer/AppNotificationController.php b/app/Http/Controllers/Customer/AppNotificationController.php index 1842f15..4ab374f 100644 --- a/app/Http/Controllers/Customer/AppNotificationController.php +++ b/app/Http/Controllers/Customer/AppNotificationController.php @@ -15,7 +15,7 @@ class AppNotificationController extends Controller { private function assertFeatureEnabled(): void { - if (! app(ConfigService::class)->getBool('has_page_notification', false)) { + if (! app(ConfigService::class)->getBool('has_page_notification', true)) { throw new NotFoundHttpException('اعلان داخل اپ غیرفعال است.'); } } diff --git a/app/Services/CustomerAppNotifyService.php b/app/Services/CustomerAppNotifyService.php index 94d038e..78f3219 100644 --- a/app/Services/CustomerAppNotifyService.php +++ b/app/Services/CustomerAppNotifyService.php @@ -31,7 +31,7 @@ class CustomerAppNotifyService return null; } - if (! $this->config->getBool('has_page_notification', false)) { + if (! $this->config->getBool('has_page_notification', true)) { return null; } diff --git a/database/migrations/2026_07_23_000004_create_app_notifications_tables.php b/database/migrations/2026_07_23_000004_create_app_notifications_tables.php index 3a5bad3..020f629 100644 --- a/database/migrations/2026_07_23_000004_create_app_notifications_tables.php +++ b/database/migrations/2026_07_23_000004_create_app_notifications_tables.php @@ -47,7 +47,7 @@ return new class extends Migration if (! $exists) { DB::table('settings')->insert([ 'key' => $key, - 'value' => 'false', + 'value' => 'true', 'title_fa' => $meta['title_fa'], 'can_edit' => 0, 'is_active' => 1, diff --git a/database/sql/deploy_settings_const.sql b/database/sql/deploy_settings_const.sql index 5d1019a..960fbe7 100644 --- a/database/sql/deploy_settings_const.sql +++ b/database/sql/deploy_settings_const.sql @@ -376,7 +376,7 @@ SELECT 'has_page_price_trigger', 'true', 'هشدار قیمت', 0, 1, WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'has_page_price_trigger' LIMIT 1); INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) -SELECT 'has_page_notification', 'false', 'اعلان داخل اپ', 0, 1, +SELECT 'has_page_notification', 'true', 'اعلان داخل اپ', 0, 1, 'روشن: زنگوله اعلان در اپ کاربر و منوی ثبت اعلان در ادمین فعال است. خاموش: مخفی است. فقط از دیپلوی قابل تغییر است.', 'switch' WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'has_page_notification' LIMIT 1); @@ -1344,6 +1344,8 @@ UPDATE `settings` SET `description` = 'روشن: منوی «کسب درآمد / UPDATE `settings` SET `description` = 'روشن: منوی هشدار قیمت در اپ کاربر نمایش داده می‌شود. خاموش: منو و صفحه مخفی است. فقط از دیپلوی قابل تغییر است.' WHERE `key` = 'has_page_price_trigger'; UPDATE `settings` SET `description` = 'روشن: زنگوله اعلان در اپ کاربر و منوی ثبت اعلان در ادمین فعال است. خاموش: مخفی است. فقط از دیپلوی قابل تغییر است.' WHERE `key` = 'has_page_notification'; UPDATE `settings` SET `title_fa` = 'اعلان داخل اپ' WHERE `key` = 'has_page_notification'; +-- محصول: اعلان داخل اپ پیش‌فرض روشن برای همه دیپلوی‌ها (can_edit=0؛ فقط از دیپلوی) +UPDATE `settings` SET `value` = 'true' WHERE `key` = 'has_page_notification'; UPDATE `settings` SET `description` = 'شماره موبایل حساب API سرویس همکار قیمت. برای دریافت توکن و لیست محصولات.' WHERE `key` = 'montzar_mobile'; UPDATE `settings` SET `description` = 'رمز عبور حساب API سرویس همکار قیمت. محرمانه نگه دارید.' WHERE `key` = 'montzar_password'; diff --git a/database/sql/deploy_settings_const_preserve_value_sync_can_edit.sql b/database/sql/deploy_settings_const_preserve_value_sync_can_edit.sql index 5fb1dba..c159bae 100644 --- a/database/sql/deploy_settings_const_preserve_value_sync_can_edit.sql +++ b/database/sql/deploy_settings_const_preserve_value_sync_can_edit.sql @@ -331,7 +331,7 @@ SELECT 'has_page_price_trigger', 'true', 'هشدار قیمت', 0, 1, WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'has_page_price_trigger' LIMIT 1); INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) -SELECT 'has_page_notification', 'false', 'اعلان داخل اپ', 0, 1, +SELECT 'has_page_notification', 'true', 'اعلان داخل اپ', 0, 1, 'روشن: زنگوله اعلان در اپ کاربر و منوی ثبت اعلان در ادمین فعال است. خاموش: مخفی است. فقط از دیپلوی قابل تغییر است.', 'switch' WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'has_page_notification' LIMIT 1); @@ -1226,6 +1226,8 @@ UPDATE `settings` SET `description` = 'روشن: منوی «کسب درآمد / UPDATE `settings` SET `description` = 'روشن: منوی هشدار قیمت در اپ کاربر نمایش داده می‌شود. خاموش: منو و صفحه مخفی است. فقط از دیپلوی قابل تغییر است.' WHERE `key` = 'has_page_price_trigger'; UPDATE `settings` SET `description` = 'روشن: زنگوله اعلان در اپ کاربر و منوی ثبت اعلان در ادمین فعال است. خاموش: مخفی است. فقط از دیپلوی قابل تغییر است.' WHERE `key` = 'has_page_notification'; UPDATE `settings` SET `title_fa` = 'اعلان داخل اپ' WHERE `key` = 'has_page_notification'; +-- محصول: اعلان داخل اپ پیش‌فرض روشن برای همه دیپلوی‌ها (can_edit=0؛ فقط از دیپلوی) +UPDATE `settings` SET `value` = 'true' WHERE `key` = 'has_page_notification'; UPDATE `settings` SET `description` = 'شماره موبایل حساب API سرویس همکار قیمت. برای دریافت توکن و لیست محصولات.' WHERE `key` = 'montzar_mobile'; UPDATE `settings` SET `description` = 'رمز عبور حساب API سرویس همکار قیمت. محرمانه نگه دارید.' WHERE `key` = 'montzar_password';