added gholak

This commit is contained in:
2026-08-01 17:30:14 +03:30
parent 9642e603e7
commit eaff9dead2
12 changed files with 538 additions and 75 deletions
@@ -0,0 +1,34 @@
<?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('funds')) {
return;
}
Schema::table('funds', function (Blueprint $table) {
if (! Schema::hasColumn('funds', 'product_id')) {
$table->unsignedBigInteger('product_id')->nullable()->after('customer_id');
$table->index('product_id');
}
});
}
public function down(): void
{
if (! Schema::hasTable('funds') || ! Schema::hasColumn('funds', 'product_id')) {
return;
}
Schema::table('funds', function (Blueprint $table) {
$table->dropIndex(['product_id']);
$table->dropColumn('product_id');
});
}
};
+10 -1
View File
@@ -399,6 +399,12 @@ SELECT 'enable_conditional_order', 'false', 'سفارش شرطی', 0, 1,
'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'enable_conditional_order' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'enable_product_funds', 'false', 'قلک محصول', 0, 1,
'روشن: ساخت و مدیریت قلک per-product در اپ مشتری فعال است (یک محصول در هر قلک؛ انتقال بدون سند حسابداری). خاموش: منو و API ساخت قلک جدید در دسترس نیست. فقط از دیپلوی قابل تغییر است.',
'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'enable_product_funds' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'has_page_price_trigger', 'true', 'هشدار قیمت', 0, 1,
'روشن: منوی هشدار قیمت در اپ کاربر نمایش داده می‌شود. خاموش: منو و صفحه مخفی است. فقط از دیپلوی قابل تغییر است.',
@@ -1077,7 +1083,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', 'charge_notif', 'group_sms', 'sms_panel', 'customer_direct_sms',
'enable_conditional_order',
'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',
'sms_notif_gateway_charge_admin', 'sms_notif_register_customer', 'sms_notif_register_admin',
@@ -1551,6 +1557,8 @@ UPDATE `settings` SET `title_fa` = 'پیامک تکی به مشتری از لی
UPDATE `settings` SET `description` = 'روشن: سرویس احراز هویت جیبیت (تطبیق کد ملی/موبایل و کارت بانکی) فعال است. خاموش: هیچ فراخوانی به جیبیت انجام نمی‌شود و احراز هویت خودکار کار نمی‌کند. فقط از صفحه دیپلوی قابل تغییر است.' WHERE `key` = 'jibit_enabled';
UPDATE `settings` SET `title_fa` = 'احراز هویت جیبیت' WHERE `key` = 'jibit_enabled';
UPDATE `settings` SET `title_fa` = 'سفارش شرطی' WHERE `key` = 'enable_conditional_order';
UPDATE `settings` SET `title_fa` = 'قلک محصول' WHERE `key` = 'enable_product_funds';
UPDATE `settings` SET `description` = 'روشن: ساخت و مدیریت قلک per-product در اپ مشتری فعال است (یک محصول در هر قلک؛ انتقال بدون سند حسابداری). خاموش: منو و API ساخت قلک جدید در دسترس نیست. فقط از دیپلوی قابل تغییر است.' WHERE `key` = 'enable_product_funds';
UPDATE `settings` SET `description` = 'روشن: امکان ارسال پیامک گروهی از پنل ادمین فعال است.' WHERE `key` = 'group_sms';
UPDATE `settings` SET `description` = 'روشن: پنل پیامک و کیف پول billing فعال است. خاموش: پیامک‌ها مثل قبل ارسال می‌شوند بدون billing.' WHERE `key` = 'sms_panel';
@@ -1805,6 +1813,7 @@ UPDATE `settings` SET `can_edit` = 0 WHERE `key` IN (
'group_sms',
'customer_direct_sms',
'enable_conditional_order',
'enable_product_funds',
'has_page_price_trigger',
'has_page_notification',
'jibit_enabled',
@@ -354,6 +354,12 @@ SELECT 'enable_conditional_order', 'false', 'سفارش شرطی', 0, 1,
'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'enable_conditional_order' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'enable_product_funds', 'false', 'قلک محصول', 0, 1,
'روشن: ساخت و مدیریت قلک per-product در اپ مشتری فعال است (یک محصول در هر قلک؛ انتقال بدون سند حسابداری). خاموش: منو و API ساخت قلک جدید در دسترس نیست. فقط از دیپلوی قابل تغییر است.',
'switch'
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'enable_product_funds' LIMIT 1);
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
SELECT 'has_page_price_trigger', 'true', 'هشدار قیمت', 0, 1,
'روشن: منوی هشدار قیمت در اپ کاربر نمایش داده می‌شود. خاموش: منو و صفحه مخفی است. فقط از دیپلوی قابل تغییر است.',
@@ -861,7 +867,7 @@ UPDATE `settings` SET `type` = 'switch' WHERE `key` IN (
'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',
'enable_conditional_order',
'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',
'sms_notif_gateway_charge_admin', 'sms_notif_register_customer', 'sms_notif_register_admin',
@@ -1333,6 +1339,9 @@ UPDATE `settings` SET `title_fa` = 'پیامک تکی به مشتری از لی
UPDATE `settings` SET `description` = 'روشن: سرویس احراز هویت جیبیت (تطبیق کد ملی/موبایل و کارت بانکی) فعال است. خاموش: هیچ فراخوانی به جیبیت انجام نمی‌شود و احراز هویت خودکار کار نمی‌کند. فقط از صفحه دیپلوی قابل تغییر است.' WHERE `key` = 'jibit_enabled';
UPDATE `settings` SET `title_fa` = 'احراز هویت جیبیت' WHERE `key` = 'jibit_enabled';
UPDATE `settings` SET `title_fa` = 'سفارش شرطی' WHERE `key` = 'enable_conditional_order';
UPDATE `settings` SET `title_fa` = 'قلک محصول' WHERE `key` = 'enable_product_funds';
UPDATE `settings` SET `description` = 'روشن: ساخت و مدیریت قلک per-product در اپ مشتری فعال است (یک محصول در هر قلک؛ انتقال بدون سند حسابداری). خاموش: منو و API ساخت قلک جدید در دسترس نیست. فقط از دیپلوی قابل تغییر است.' WHERE `key` = 'enable_product_funds';
UPDATE `settings` SET `can_edit` = 0 WHERE `key` = 'enable_product_funds';
UPDATE `settings` SET `description` = 'روشن: بعد از شارژ یا کسر کیف توسط ادمین، پیامک به مشتری و ادمین‌های دارای «ارسال پیامک» می‌رود. خاموش: هیچ‌کدام ارسال نمی‌شود.' WHERE `key` = 'charge_notif';
UPDATE `settings` SET `description` = 'روشن: بعد از خرید یا فروش موفق، پیامک خلاصه معامله به ادمین‌های دارای «ارسال پیامک» می‌رود. خاموش: ادمین پیامک معامله نمی‌گیرد.' WHERE `key` = 'sms_notif_order_admin';
UPDATE `settings` SET `description` = 'روشن: بعد از خرید یا فروش موفق، پیامک رسید به مشتری می‌رود. خاموش: مشتری پیامک معامله نمی‌گیرد.' WHERE `key` = 'sms_notif_order_customer';
@@ -1401,6 +1410,7 @@ UPDATE `settings` SET `can_edit` = 0 WHERE `key` IN (
'group_sms',
'customer_direct_sms',
'enable_conditional_order',
'enable_product_funds',
'has_page_price_trigger',
'has_page_notification',
'jibit_enabled',