added setting for user

This commit is contained in:
2026-08-16 22:00:23 +03:30
parent c3c3a60088
commit bd8284e4f8
11 changed files with 769 additions and 12 deletions
@@ -0,0 +1,60 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
if (! Schema::hasTable('customer_special_price_packages')) {
Schema::create('customer_special_price_packages', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->unsignedBigInteger('profit_buy')->default(0);
$table->unsignedBigInteger('profit_sell')->default(0);
$table->boolean('show_product')->default(true);
$table->boolean('is_active')->default(true);
$table->timestamps();
});
}
if (! Schema::hasTable('customer_special_price_package_customer')) {
Schema::create('customer_special_price_package_customer', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('package_id');
$table->unsignedBigInteger('customer_id');
$table->unique(['package_id', 'customer_id'], 'cspp_customer_unique');
$table->index('customer_id', 'cspp_customer_id_idx');
});
}
if (! Schema::hasTable('customer_special_price_package_category')) {
Schema::create('customer_special_price_package_category', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('package_id');
$table->string('category_name');
$table->unique(['package_id', 'category_name'], 'cspp_category_unique');
});
}
if (! Schema::hasTable('customer_special_price_package_product')) {
Schema::create('customer_special_price_package_product', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('package_id');
$table->unsignedBigInteger('product_id');
$table->unique(['package_id', 'product_id'], 'cspp_product_unique');
$table->index('product_id', 'cspp_product_id_idx');
});
}
}
public function down(): void
{
Schema::dropIfExists('customer_special_price_package_product');
Schema::dropIfExists('customer_special_price_package_category');
Schema::dropIfExists('customer_special_price_package_customer');
Schema::dropIfExists('customer_special_price_packages');
}
};
+14 -1
View File
@@ -554,6 +554,12 @@ SELECT 'group_sms', 'false', 'پیامک گروهی', 0, 1,
'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'group_sms' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'customer_special_pricing', 'false', 'قیمت ویژه مشتری', 0, 1,
'روشن: زیرمنوی قیمت ویژه در مشتریان و اعمال سود خرید/فروش پکیج روی مظنه و سفارش برای کاربران انتخاب‌شده. خاموش: غیرفعال. فقط از دیپلوی قابل تغییر است.',
'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'customer_special_pricing' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'sms_panel', 'true', 'پنل پیامک (کیف پول)', 0, 1, 'روشن: پنل پیامک و کیف پول billing فعال است. خاموش: پیامک‌ها مثل قبل ارسال می‌شوند بدون billing.', 'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'sms_panel' LIMIT 1);
@@ -1159,7 +1165,7 @@ UPDATE `settings` SET `type` = 'switch' WHERE `key` IN (
'require_zero_main_gold_before_other_buy',
'profit_gold_api_enabled', 'payping_round_toman', 'payping_strict_failed_withdraw',
'has_page_earn_money', 'has_page_price_trigger', 'has_page_notification', 'has_page_gift_card',
'enable_customer_level_profit', 'charge_notif', 'group_sms', 'sms_panel', 'customer_direct_sms',
'enable_customer_level_profit', 'charge_notif', 'group_sms', 'customer_special_pricing', 'sms_panel', 'customer_direct_sms',
'enable_conditional_order', 'enable_product_funds',
'sms_notif_order_admin', 'sms_notif_order_customer',
'sms_notif_withdraw_admin', 'sms_notif_withdraw_otp', 'sms_notif_login_otp',
@@ -1774,6 +1780,12 @@ UPDATE `settings` SET `title_fa` = 'اعمال مبلغ دقیق در معامل
UPDATE `settings` SET `title_fa` = 'پاداش معرف‌شونده' WHERE `key` = 'gift_for_referral';
UPDATE `settings` SET `title_fa` = 'پاداش معرف' WHERE `key` = 'gift_for_referrer';
UPDATE `settings` SET `title_fa` = 'پیامک گروهی' WHERE `key` = 'group_sms';
UPDATE `settings` SET
`title_fa` = 'قیمت ویژه مشتری',
`type` = 'switch',
`can_edit` = 0,
`description` = 'روشن: زیرمنوی قیمت ویژه در مشتریان و اعمال سود خرید/فروش پکیج روی مظنه و سفارش برای کاربران انتخاب‌شده. خاموش: غیرفعال. فقط از دیپلوی قابل تغییر است.'
WHERE `key` = 'customer_special_pricing';
UPDATE `settings` SET `title_fa` = 'پنل پیامک (کیف پول)' WHERE `key` = 'sms_panel';
UPDATE `settings` SET
`title_fa` = 'چت پشتیبانی',
@@ -1931,6 +1943,7 @@ UPDATE `settings` SET `can_edit` = 0 WHERE `key` IN (
'fee_deduct_from_gold',
'referral_bonus_amount',
'group_sms',
'customer_special_pricing',
'customer_direct_sms',
'enable_conditional_order',
'enable_product_funds',
@@ -497,6 +497,12 @@ SELECT 'group_sms', 'false', 'پیامک گروهی', 0, 1,
'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'group_sms' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'customer_special_pricing', 'false', 'قیمت ویژه مشتری', 0, 1,
'روشن: زیرمنوی قیمت ویژه در مشتریان و اعمال سود خرید/فروش پکیج روی مظنه و سفارش برای کاربران انتخاب‌شده. خاموش: غیرفعال. فقط از دیپلوی قابل تغییر است.',
'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'customer_special_pricing' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'sms_panel', 'true', 'پنل پیامک (کیف پول)', 0, 1, 'روشن: پنل پیامک و کیف پول billing فعال است. خاموش: پیامک‌ها مثل قبل ارسال می‌شوند بدون billing.', 'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'sms_panel' LIMIT 1);
@@ -898,7 +904,7 @@ UPDATE `settings` SET `type` = 'switch' WHERE `key` IN (
'products_site_link_enabled',
'fee_deduct_from_gold',
'send_to_tahesab', 'profit_gold_api_enabled', 'payping_round_toman', 'payping_strict_failed_withdraw',
'has_page_earn_money', 'has_page_price_trigger', 'has_page_notification', 'charge_notif', 'group_sms', 'sms_panel', 'customer_direct_sms',
'has_page_earn_money', 'has_page_price_trigger', 'has_page_notification', 'charge_notif', 'group_sms', 'customer_special_pricing', 'sms_panel', 'customer_direct_sms',
'enable_conditional_order', 'enable_product_funds',
'sms_notif_order_admin', 'sms_notif_order_customer',
'sms_notif_withdraw_admin', 'sms_notif_withdraw_otp', 'sms_notif_login_otp',
@@ -1408,6 +1414,12 @@ UPDATE `settings` SET `description` = 'رمز مشترک بین لاراول و
UPDATE `settings` SET `title_fa` = 'پیامک پیام پشتیبانی به ادمین' WHERE `key` = 'sms_notif_support_admin';
UPDATE `settings` SET `title_fa` = 'رمز وب‌هوک چت' WHERE `key` = 'chat_webhook_secret';
UPDATE `settings` SET `description` = 'روشن: دکمه ارسال پیامک گروهی در پنل ادمین فعال است (ارسال ۱۰تایی). خاموش: ارسال پیامک گروهی غیرفعال است. فقط از تنظیمات پیشرفته.' WHERE `key` = 'group_sms';
UPDATE `settings` SET
`title_fa` = 'قیمت ویژه مشتری',
`type` = 'switch',
`can_edit` = 0,
`description` = 'روشن: زیرمنوی قیمت ویژه در مشتریان و اعمال سود خرید/فروش پکیج روی مظنه و سفارش برای کاربران انتخاب‌شده. خاموش: غیرفعال. فقط از دیپلوی قابل تغییر است.'
WHERE `key` = 'customer_special_pricing';
UPDATE `settings` SET `description` = 'روشن: پنل پیامک و کیف پول billing فعال است. خاموش: پیامک‌ها مثل قبل ارسال می‌شوند بدون billing.' WHERE `key` = 'sms_panel';
UPDATE `settings` SET `description` = 'محصولاتی که موجودی‌شان از کیف طلای اصلی خوانده می‌شود. چند محصول با کاما. پیش‌فرض: 13' WHERE `key` = 'main_wallet_products';
@@ -1457,6 +1469,7 @@ UPDATE `settings` SET `can_edit` = 0 WHERE `key` IN (
'external_order_api_enabled',
'referral_bonus_amount',
'group_sms',
'customer_special_pricing',
'customer_direct_sms',
'enable_conditional_order',
'enable_product_funds',