added merge wallet 6
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('fname',100)->nullable();
|
||||
$table->string('lname',100)->nullable();
|
||||
$table->string('name',200)->nullable();
|
||||
$table->boolean('active')->default(true);
|
||||
$table->string('mobile',20)->nullable();
|
||||
$table->integer('avatar_id')->nullable()->unsigned();
|
||||
$table->timestamp('last_seen_at')->nullable();
|
||||
$table->tinyInteger('sts')->nullable()->unsigned();
|
||||
$table->integer('user_type')->nullable()->unsigned();
|
||||
$table->string('token_sms',10)->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePasswordResetsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('password_resets', function (Blueprint $table) {
|
||||
$table->string('email')->index();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('password_resets');
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFailedJobsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->text('connection');
|
||||
$table->text('queue');
|
||||
$table->longText('payload');
|
||||
$table->longText('exception');
|
||||
$table->timestamp('failed_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePersonalAccessTokensTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('personal_access_tokens', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->morphs('tokenable');
|
||||
$table->string('name');
|
||||
$table->string('token', 64)->unique();
|
||||
$table->text('abilities')->nullable();
|
||||
$table->timestamp('last_used_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('personal_access_tokens');
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateCustomersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('customers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('fname',100)->nullable();
|
||||
$table->string('lname',100)->nullable();
|
||||
$table->string('name',200)->nullable();
|
||||
$table->boolean('active')->default(true);
|
||||
$table->string('mobile',20)->nullable();
|
||||
$table->integer('avatar_id')->nullable()->unsigned();
|
||||
$table->timestamp('last_seen_at')->nullable();
|
||||
$table->integer('default_address_id')->nullable()->unsigned();
|
||||
$table->tinyInteger('sts')->nullable()->unsigned();
|
||||
$table->tinyInteger('type')->default(1);
|
||||
$table->integer('total_transaction')->default(0);
|
||||
$table->string('token_sms',10)->nullable();
|
||||
$table->string('password')->nullable();
|
||||
$table->integer('orders_count')->default(0);
|
||||
$table->timestamp('birth_date')->nullable();
|
||||
$table->string('shop_name',100)->nullable();
|
||||
$table->string('phone_number',20)->nullable();
|
||||
$table->string('city',50)->nullable();
|
||||
$table->string('province',50)->nullable();
|
||||
$table->string('n_code',20)->nullable();
|
||||
$table->boolean('is_archive')->default(0);
|
||||
$table->boolean('trade_active')->default(0);
|
||||
$table->integer('gram')->default(0);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('customers');
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateConst extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('const', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('key',50)->nullable();
|
||||
$table->string('title_fa',50)->nullable();
|
||||
$table->string('value',100)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('const');
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOrdersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('orders', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('customer_id')->nullable()->unsigned();
|
||||
$table->tinyInteger('sts')->nullable()->unsigned();
|
||||
$table->tinyInteger('direction')->nullable()->unsigned();
|
||||
$table->tinyInteger('payment_sts')->nullable()->unsigned();
|
||||
$table->tinyInteger('type')->default(1);
|
||||
$table->double('amount',15,6)->nullable()->unsigned();
|
||||
$table->integer('total_fee')->nullable()->unsigned();
|
||||
$table->integer('price')->nullable()->unsigned();
|
||||
$table->integer('price_original')->nullable()->unsigned();
|
||||
$table->integer('total_price')->nullable()->unsigned();
|
||||
$table->integer('total_price_original')->nullable()->unsigned();
|
||||
$table->integer('fee')->nullable()->unsigned();
|
||||
$table->integer('payment_remind')->nullable()->unsigned();
|
||||
$table->integer('payment_amount')->nullable()->unsigned();
|
||||
$table->string('description',1024)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('orders');
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePricesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('prices', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('price')->nullable()->unsigned();
|
||||
$table->date('date_at')->nullable();
|
||||
$table->time('time_at')->nullable();
|
||||
$table->integer('user_id')->nullable()->unsigned();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('prices');
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePriceCandlesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('price_candles', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('start')->nullable()->unsigned();
|
||||
$table->integer('end')->nullable()->unsigned();
|
||||
$table->integer('high')->nullable()->unsigned();
|
||||
$table->integer('low')->nullable()->unsigned();
|
||||
$table->date('date_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('price_candles');
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateLogsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('user_id')->unsigned()->nullable();
|
||||
$table->integer('customer_id')->unsigned()->nullable();
|
||||
$table->string('data',1024)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('logs');
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFundsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('funds', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title',100)->nullable();
|
||||
$table->integer('file_id')->nullable()->unsigned();
|
||||
$table->integer('customer_id')->nullable()->unsigned();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('funds');
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWithdrawsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('withdraws', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('customer_id')->unsigned()->nullable();
|
||||
$table->integer('user_id')->unsigned()->nullable();
|
||||
$table->bigInteger('cash')->unsigned()->nullable();
|
||||
$table->double('gold')->unsigned()->nullable();
|
||||
$table->string('tracked_number',50)->nullable();
|
||||
$table->timestamp('date_at')->nullable();
|
||||
$table->tinyInteger('sts')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('withdraws');
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateBankAccountsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('bank_accounts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('customer_id')->nullable()->unsigned();
|
||||
$table->string('cart_number')->nullable();
|
||||
$table->string('shaba_number')->nullable();
|
||||
$table->string('bank_name')->nullable();
|
||||
$table->string('account_number')->nullable();
|
||||
$table->tinyInteger('sts')->default(1);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('bank_accounts');
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddProviderFieldsToOrdersTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if (!Schema::hasColumn('orders', 'provider_id')) {
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('provider_id')
|
||||
->nullable()
|
||||
->after('id')
|
||||
->index();
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('orders', 'total_price_montzar')) {
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->decimal('total_price_montzar', 20, 4)
|
||||
->nullable()
|
||||
->after('total_price');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
if (Schema::hasColumn('orders', 'total_price_montzar')) {
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->dropColumn('total_price_montzar');
|
||||
});
|
||||
}
|
||||
|
||||
if (Schema::hasColumn('orders', 'provider_id')) {
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->dropIndex(['provider_id']);
|
||||
$table->dropColumn('provider_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<?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('products')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('products', 'price_offset_percent')) {
|
||||
$table->decimal('price_offset_percent', 8, 2)->default(0)->after('price_profit');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (!Schema::hasTable('products')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Schema::hasColumn('products', 'price_offset_percent')) {
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->dropColumn('price_offset_percent');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTotalReferralsToCustomersTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if (Schema::hasColumn('customers', 'total_referrals')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('customers', function (Blueprint $table) {
|
||||
$table->unsignedInteger('total_referrals')->default(0)->after('referral_to_id');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
if (!Schema::hasColumn('customers', 'total_referrals')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('customers', function (Blueprint $table) {
|
||||
$table->dropColumn('total_referrals');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AlterLogsDataToLongtext extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
DB::statement('ALTER TABLE `logs` MODIFY COLUMN `data` LONGTEXT NULL');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
DB::statement('ALTER TABLE `logs` MODIFY COLUMN `data` VARCHAR(1024) NULL');
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?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('products')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('products', 'order_limit_enabled')) {
|
||||
$table->boolean('order_limit_enabled')->default(false)->after('percent_fee_buy');
|
||||
}
|
||||
if (!Schema::hasColumn('products', 'min_order_cash')) {
|
||||
$table->unsignedBigInteger('min_order_cash')->nullable()->after('order_limit_enabled');
|
||||
}
|
||||
if (!Schema::hasColumn('products', 'max_order_cash')) {
|
||||
$table->unsignedBigInteger('max_order_cash')->nullable()->after('min_order_cash');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (!Schema::hasTable('products')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$columns = ['order_limit_enabled', 'min_order_cash', 'max_order_cash'];
|
||||
foreach ($columns as $column) {
|
||||
if (Schema::hasColumn('products', $column)) {
|
||||
$table->dropColumn($column);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if (!Schema::hasTable('products')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('products', 'show_in_assets')) {
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('products', 'show')) {
|
||||
$table->boolean('show_in_assets')->default(false)->after('show');
|
||||
} else {
|
||||
$table->boolean('show_in_assets')->default(false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
DB::statement(
|
||||
'ALTER TABLE `products` MODIFY COLUMN `show_in_assets` TINYINT(1) NOT NULL DEFAULT 0'
|
||||
);
|
||||
DB::table('products')->update(['show_in_assets' => 0]);
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (!Schema::hasTable('products') || !Schema::hasColumn('products', 'show_in_assets')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->dropColumn('show_in_assets');
|
||||
});
|
||||
}
|
||||
};
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
<?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('products')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('products', 'use_last_price_if_zero')) {
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('products', 'show_in_assets')) {
|
||||
$table->boolean('use_last_price_if_zero')->default(false)->after('show_in_assets');
|
||||
} else {
|
||||
$table->boolean('use_last_price_if_zero')->default(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (!Schema::hasTable('products') || !Schema::hasColumn('products', 'use_last_price_if_zero')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->dropColumn('use_last_price_if_zero');
|
||||
});
|
||||
}
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
-- =============================================================================
|
||||
-- baseline migrations — برای دیتابیسهایی که schema از قبل دارند (مثل groosy)
|
||||
-- =============================================================================
|
||||
-- بعد از import یا روی DB موجود اجرا کنید تا Laravel schema dump را دوباره
|
||||
-- load نکند و فقط migrationهای جدید با php artisan migrate اجرا شوند.
|
||||
--
|
||||
-- USE `نام_دیتابیس`;
|
||||
-- =============================================================================
|
||||
|
||||
TRUNCATE TABLE `migrations`;
|
||||
|
||||
INSERT INTO `migrations` (`migration`, `batch`) VALUES
|
||||
('0000_00_00_000000_baseline_schema', 1);
|
||||
@@ -0,0 +1,579 @@
|
||||
-- =============================================================================
|
||||
-- deploy_settings_const.sql — آپدیت settings + const (بدون تغییر schema)
|
||||
--
|
||||
-- workflow deploy:
|
||||
-- 1) php artisan migrate
|
||||
-- 2) mysql -u USER -p DATABASE < database/sql/deploy_settings_const.sql
|
||||
--
|
||||
-- اصول:
|
||||
-- • چند بار قابل اجرا (idempotent)
|
||||
-- • value کلیدهای موجود دست نخورده (فقط INSERT اگر key نبود)
|
||||
-- • title_fa / type / description / can_edit بهروز میشود
|
||||
-- • schema (جدول/ستون) فقط با migrate — نه این فایل
|
||||
--
|
||||
-- قبل از اجرا: USE `نام_دیتابیس`; + بکاپ
|
||||
-- =============================================================================
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- charset — نمایش فارسی در پنل ادمین
|
||||
-- ---------------------------------------------------------------------------
|
||||
ALTER TABLE `settings`
|
||||
MODIFY COLUMN `description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
|
||||
MODIFY COLUMN `title_fa` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
|
||||
MODIFY COLUMN `type` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL;
|
||||
|
||||
ALTER TABLE `const`
|
||||
MODIFY COLUMN `title_fa` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- اصلاح باگها / rename کلیدهای قدیمی
|
||||
-- ---------------------------------------------------------------------------
|
||||
UPDATE `settings` SET `key` = 'logo_login', `value` = 'logo_login' WHERE `key` LIKE 'logo_login%';
|
||||
|
||||
DELETE s1 FROM `settings` s1
|
||||
INNER JOIN `settings` s2 ON s1.`key` = s2.`key` AND s1.`id` < s2.`id`
|
||||
WHERE s1.`key` = 'montzar_closed';
|
||||
|
||||
UPDATE `settings` SET `key` = 'support_messenger_id' WHERE `key` = 'bale_support_id';
|
||||
UPDATE `settings` SET `key` = 'support_messenger_text' WHERE `key` = 'bale_support_text';
|
||||
|
||||
UPDATE `settings` AS r
|
||||
SET r.`value` = 'required', r.`is_active` = 1, r.`updated_at` = NOW()
|
||||
WHERE r.`key` = 'referral_id'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM (
|
||||
SELECT `value`, `is_active` FROM `settings`
|
||||
WHERE `key` = 'is_requaire_referral' LIMIT 1
|
||||
) AS leg
|
||||
WHERE leg.`is_active` = 1
|
||||
AND LOWER(TRIM(COALESCE(leg.`value`, ''))) IN ('true', '1', 'yes')
|
||||
)
|
||||
AND TRIM(COALESCE(r.`value`, '')) <> 'required';
|
||||
|
||||
|
||||
-- SETTINGS — کلیدهای جدید (مقادیر پیشفرض گلد علی / zaarbox)
|
||||
-- =============================================================================
|
||||
|
||||
-- قیمت zaarbox (اگر از قبل دارید value دست نخورده)
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'chart_id', '', 'UUID نمودار Zaarbox', 1, 1, 'خالی = ca3800a0-1f57-3528-b963-178f9168e04f'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'chart_id' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'etehadie_api_url', 'https://price.zaarbox.ir/api/free', 'آدرس API اتحادیه (پشتیبان)', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'etehadie_api_url' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'show_last_price', 'true', 'نمایش آخرین قیمت DB اگر API قطع شد', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'show_last_price' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'main_product_price', 'false', 'قیمت از محصول (legacy)', 1, 1, 'از price_provider استفاده کنید'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'main_product_price' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'tabanGohar_price', 'false', 'قیمت تابان گوهر', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'tabanGohar_price' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_price', 'false', 'قیمت از همکار (montzar)', 1, 1, 'معمولاً false وقتی price_provider=zaarbox'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_price' LIMIT 1);
|
||||
|
||||
-- Montzar — برای تعویض provider یا پر شدن خودکار توسط cron
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_mobile', '', 'موبایل API همکار', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_mobile' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_password', '', 'رمز API همکار', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_password' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_product_id', '25', 'کد محصول همکار', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_product_id' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_base_url', 'https://limangold.ir', 'آدرس سرور همکار', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_base_url' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_token', '', 'توکن همکار (خودکار)', 0, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_token' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_open_buy', 'true', 'باز بودن خرید همکار', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_open_buy' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_open_sell', 'true', 'باز بودن فروش همکار', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_open_sell' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_diff', '0', 'اختلاف قیمت همکار', 0, 1, 'سیستم پر میکند'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_diff' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_live_price', '0', 'قیمت لحظهای همکار', 0, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_live_price' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_mazaneh', '0', 'مظنه همکار', 0, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_mazaneh' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_truly_buy_mazaneh', '0', 'مظنه خرید همکار', 0, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_truly_buy_mazaneh' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'montzar_truly_sell_mazaneh', '0', 'مظنه فروش همکار', 0, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'montzar_truly_sell_mazaneh' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'display_montzar', 'false', 'نمایش بلوک همکار در UI', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'display_montzar' LIMIT 1);
|
||||
|
||||
-- API خارجی Node (HMAC) — معادل NODE_CLIENT_ID / NODE_SHARED_SECRET در .env
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'node_client_id', '', 'شناسه کلاینت API خارجی (X-Client-Id)', 1, 1, 'مقدار قبلی .env: NODE_CLIENT_ID'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'node_client_id' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'node_shared_secret', '', 'کلید امضای HMAC API خارجی', 1, 1, 'مقدار قبلی .env: NODE_SHARED_SECRET'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'node_shared_secret' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'external_order_api_enabled', 'true', 'فعالسازی API سفارش خارجی (get_wallet / order)', 1, 1, 'true + node_client_id + node_shared_secret'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'external_order_api_enabled' LIMIT 1);
|
||||
|
||||
-- Jibit
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'jibit_verification', 'true', 'تأیید کارت بانکی با جیبیت', 1, 1, 'true/false — BankAccountController'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'jibit_verification' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'register_jibit_verify', 'true', 'تأیید کدملی/موبایل در ثبتنام', 1, 1, 'AuthController'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'register_jibit_verify' LIMIT 1);
|
||||
|
||||
-- ساعات معامله
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'close_price', 'false', 'بستن قیمت در بازه زمانی', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'close_price' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'startDay', '09:00', 'شروع بازه معامله', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'startDay' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'endDay', '22:00', 'پایان بازه معامله', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'endDay' LIMIT 1);
|
||||
|
||||
-- ثبتنام / معرف
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'auto_active_customer', 'false', 'فعالسازی خودکار کاربر', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'auto_active_customer' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'fee_free', '0', 'تعداد سفارش اول بدون کارمزد', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'fee_free' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'charge_notif', 'false', 'پیامک شارژ ادمین', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'charge_notif' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'gift_for_referrer', '0.005', 'پاداش معرف', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'gift_for_referrer' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'gift_for_referral', '0', 'پاداش معرفشونده', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'gift_for_referral' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'register_referral_sms_to_referrer', 'false', 'SMS به معرف هنگام ثبتنام', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'register_referral_sms_to_referrer' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'register_referral_bonus_message', 'false', 'پیام پاداش در SMS ثبتنام', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'register_referral_bonus_message' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'referral_limit', '', 'محدودیت دعوت', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'referral_limit' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'group_sms', 'false', 'پیامک گروهی', 1, 1, NULL
|
||||
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`)
|
||||
SELECT 'tahesab_token', '', 'توکن تهحساب', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'tahesab_token' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'tahesab_db', '', 'دیتابیس تهحساب', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'tahesab_db' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'tahesab_bank_account', '', 'حساب بانکی تهحساب', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'tahesab_bank_account' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'telegram_bot_token', '', 'توکن بات تلگرام', 0, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'telegram_bot_token' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'bale_bot_token', '', 'توکن بات بله', 0, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'bale_bot_token' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'support_messenger_id', '', 'شناسه پشتیبانی پیامرسان', 1, 0, 'بله: یوزرنیم ble.ir | تلگرام: یوزرنیم | واتساپ: شماره با کد کشور | روبیکا/ایتا/سروش: یوزرنیم'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'support_messenger_id' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'support_messenger_text', '', 'متن پشتیبانی پیامرسان', 1, 0, 'متن دکمه یا توضیح پشتیبانی در اپ کاربر'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'support_messenger_text' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'support_messenger', 'bale', 'پیامرسان پشتیبانی', 1, 1, 'bale,telegram,whatsapp,rubika,eitaa,soroush'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'support_messenger' LIMIT 1);
|
||||
|
||||
-- min/max قیمت روز (سیستم)
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'up_price', '0', 'بیشترین قیمت امروز', 0, 1, 'ReportController'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'up_price' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'down_price', '0', 'کمترین قیمت امروز', 0, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'down_price' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'price_extreme_date', '', 'تاریخ min/max روز', 0, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'price_extreme_date' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'product_update_price_on_list', 'true', 'بروز قیمت در لیست محصول', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'product_update_price_on_list' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'product_auto_close_open_on_list', 'true', 'باز/بسته خودکار محصول', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'product_auto_close_open_on_list' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'metal_type', 'طلای آبشده', 'عنوان فلز در UI', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'metal_type' LIMIT 1);
|
||||
|
||||
-- درگاه — کلیدهای اختیاری payping
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'payping_fin_sync_enabled', 'false', 'همگامسازی fin لیمان', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_fin_sync_enabled' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'payping_fin_url', 'https://limangold.ir/kernel/admin/fin', 'URL fin', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_fin_url' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'payping_fin_token', '', 'توکن fin', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_fin_token' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'payping_fin_customer_id', '23', 'customer_id fin', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_fin_customer_id' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'payping_gateway_item', 'gp1Q', 'item تکی (legacy)', 1, 1, NULL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_gateway_item' LIMIT 1);
|
||||
|
||||
-- =============================================================================
|
||||
-- عنوان فارسی + can_edit (value دست نخورده)
|
||||
-- =============================================================================
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'منبع قیمت'), `can_edit` = 1,
|
||||
`description` = 'zaarbox | main_product | montzar | etehadie | taban_gohar'
|
||||
WHERE `key` = 'price_provider';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'محصول / UUID تابلو'), `can_edit` = 1
|
||||
WHERE `key` = 'main_product';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'آدرس API Zaarbox'), `can_edit` = 1
|
||||
WHERE `key` = 'zaarbox_api_url';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'شناسه ردیف Zaarbox'), `can_edit` = 1,
|
||||
`value` = TRIM(REPLACE(REPLACE(`value`, CHAR(10), ''), CHAR(13), ''))
|
||||
WHERE `key` = 'zaarbox_price_key';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'اختلاف پایه نمایش'), `can_edit` = 1
|
||||
WHERE `key` = 'fee_single';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'سود خرید نمایش'), `can_edit` = 1
|
||||
WHERE `key` = 'buy_fee';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'سود فروش نمایش'), `can_edit` = 1
|
||||
WHERE `key` = 'sell_fee';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'کارمزد ریالی سفارش (legacy)'), `can_edit` = 1
|
||||
WHERE `key` = 'fee_cash';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'درصد کارمزد سفارش'), `can_edit` = 1
|
||||
WHERE `key` = 'fee_service_charge_percentage';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'تأیید کارت جیبیت'), `can_edit` = 1
|
||||
WHERE `key` = 'jibit_verification';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'تأیید ثبتنام جیبیت'), `can_edit` = 1
|
||||
WHERE `key` = 'register_jibit_verify';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'شناسه کلاینت API خارجی'), `can_edit` = 1
|
||||
WHERE `key` = 'node_client_id';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'کلید HMAC API خارجی'), `can_edit` = 1
|
||||
WHERE `key` = 'node_shared_secret';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'API سفارش خارجی'), `can_edit` = 1
|
||||
WHERE `key` = 'external_order_api_enabled';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'بسته بودن همکار'), `can_edit` = 1
|
||||
WHERE `key` = 'montzar_closed';
|
||||
|
||||
UPDATE `settings` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'نام Montify'), `can_edit` = 1,
|
||||
`description` = 'RequestsController — اختیاری'
|
||||
WHERE `key` = 'montify_name';
|
||||
|
||||
-- =============================================================================
|
||||
-- CONST — کلیدهای مورد استفاده کد
|
||||
-- =============================================================================
|
||||
|
||||
INSERT INTO `const` (`key`, `value`, `title_fa`)
|
||||
SELECT 'jibit_counter', '0', 'شمارنده API جیبیت'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'jibit_counter' LIMIT 1);
|
||||
|
||||
INSERT INTO `const` (`key`, `value`, `title_fa`)
|
||||
SELECT 'app_closed', 'false', 'بسته بودن اپ (ساعات)'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'app_closed' LIMIT 1);
|
||||
|
||||
INSERT INTO `const` (`key`, `value`, `title_fa`)
|
||||
SELECT 'gram', '1', 'گرم هدیه ثبتنام'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'gram' LIMIT 1);
|
||||
|
||||
INSERT INTO `const` (`key`, `value`, `title_fa`)
|
||||
SELECT 'first_customer_wallet_value', '0', 'حداقل اولین خرید (const)'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'first_customer_wallet_value' LIMIT 1);
|
||||
|
||||
INSERT INTO `const` (`key`, `value`, `title_fa`)
|
||||
SELECT 'price', '[]', 'لیست قیمت TGJU (JSON)'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'price' LIMIT 1);
|
||||
|
||||
UPDATE `const` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'شمارنده جیبیت')
|
||||
WHERE `key` = 'jibit_counter';
|
||||
|
||||
UPDATE `const` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'سقف واریز اولیه')
|
||||
WHERE `key` = 'limited_price';
|
||||
|
||||
UPDATE `const` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'باز بودن درگاه')
|
||||
WHERE `key` = 'is_gateway_open';
|
||||
|
||||
UPDATE `const` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'محصول آبشده (fallback)')
|
||||
WHERE `key` = 'main_product';
|
||||
|
||||
-- =============================================================================
|
||||
-- نوع فیلد پنل ادمین (type) — value دست نخورده
|
||||
-- =============================================================================
|
||||
|
||||
-- longtext
|
||||
UPDATE `settings` SET `type` = 'longtext' WHERE `key` IN ('text_rule', 'text_about');
|
||||
|
||||
-- select (+ گزینهها در description)
|
||||
UPDATE `settings` SET `type` = 'select', `description` = 'montzar,zaarbox,main_product,etehadie,taban_gohar' WHERE `key` = 'price_provider';
|
||||
UPDATE `settings` SET `type` = 'select', `description` = 'required = اجباری؛ خالی = اختیاری|required,', `can_edit` = 1 WHERE `key` = 'referral_id';
|
||||
UPDATE `settings` SET `type` = 'select', `description` = 'sepal,' WHERE `key` = 'payping_gateway_name';
|
||||
UPDATE `settings` SET `type` = 'select', `description` = 'bale,telegram,whatsapp,rubika,eitaa,soroush' WHERE `key` = 'support_messenger';
|
||||
|
||||
-- switch
|
||||
UPDATE `settings` SET `type` = 'switch' WHERE `key` IN (
|
||||
'jibit_verification', 'register_jibit_verify', 'open_register', 'auto_active_customer',
|
||||
'close_price', 'montzar_price', 'main_product_price', 'tabanGohar_price', 'show_last_price',
|
||||
'send_to_tahesab', 'profit_gold_api_enabled', 'payping_round_toman', 'payping_strict_failed_withdraw',
|
||||
'has_page_earn_money', 'has_page_fund', 'has_page_permission', 'has_page_price_trigger',
|
||||
'has_page_physical_gold', 'has_chat', 'charge_notif', 'group_sms', 'display_montzar',
|
||||
'montzar_closed', 'montzar_open_buy', 'montzar_open_sell',
|
||||
'product_update_price_on_list', 'product_auto_close_open_on_list', 'payping_fin_sync_enabled',
|
||||
'fee_free', 'external_order_api_enabled'
|
||||
);
|
||||
|
||||
-- number
|
||||
UPDATE `settings` SET `type` = 'number' WHERE `key` IN (
|
||||
'fee_single', 'buy_fee', 'sell_fee', 'fee_cash', 'fee_service_charge_percentage',
|
||||
'min_withdraw', 'min_first_buy', 'minimum_sell', 'referral_count_for_gift',
|
||||
'montzar_product_id', 'balance_report_exclude_customer_id', 'gift_for_referrer',
|
||||
'gift_for_referral', 'up_price', 'down_price', 'payping_fin_customer_id'
|
||||
);
|
||||
|
||||
-- text (بقیه — URL، توکن، کلید API، ساعت، ...)
|
||||
UPDATE `settings` SET `type` = 'text' WHERE `key` IN (
|
||||
'name_fa', 'name_en', 'app_url', 'bace_url', 'logo_register', 'admin_url', 'title_pwa', 'title_fav',
|
||||
'server_url', 'key', 'main_product', 'zaarbox_api_url', 'zaarbox_price_key', 'chart_id',
|
||||
'etehadie_api_url', 'montzar_mobile', 'montzar_password', 'montzar_base_url',
|
||||
'montzar_token', 'montzar_diff', 'montzar_live_price', 'montzar_mazaneh',
|
||||
'montzar_truly_buy_mazaneh', 'montzar_truly_sell_mazaneh', 'startDay', 'endDay',
|
||||
'payping_start_url', 'payping_verify_url', 'payping_gateway_items', 'payping_fin_url',
|
||||
'payping_fin_token', 'payping_gateway_item', 'tahesab_token', 'tahesab_db',
|
||||
'node_client_id', 'node_shared_secret',
|
||||
'tahesab_bank_account', 'telegram_bot_token', 'bale_bot_token', 'support_messenger_id', 'support_messenger_text', 'referral_limit',
|
||||
'referral_bonus_amount', 'metal_type', 'montify_name', 'price_extreme_date',
|
||||
'liman_token'
|
||||
);
|
||||
|
||||
-- پیشفرض برای ردیفهای بدون type
|
||||
UPDATE `settings` SET `type` = 'text' WHERE `type` IS NULL OR TRIM(`type`) = '';
|
||||
|
||||
-- =============================================================================
|
||||
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- کلیدهای modular اضافی (INSERT اگر نبود)
|
||||
-- ---------------------------------------------------------------------------
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`, `description`)
|
||||
SELECT 'price_provider', 'منبع قیمت', 'montzar', 1, 0, 1, 'select', 'منبع فعال قیمت|montzar,zaarbox,main_product,taban_gohar,etehadie'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'price_provider' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`)
|
||||
SELECT 'service_charge_percentage', 'کارمزد درصدی (alias)', COALESCE(
|
||||
(SELECT `value` FROM `settings` WHERE `key` = 'fee_service_charge_percentage' LIMIT 1), '0.005'
|
||||
), 0, 0, 1, 'number'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'service_charge_percentage' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`)
|
||||
SELECT 'title_pwa', 'عنوان PWA', '', 1, 0, 1, 'text'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'title_pwa' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`)
|
||||
SELECT 'title_fav', 'عنوان favicon', '', 1, 0, 1, 'text'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'title_fav' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`)
|
||||
SELECT 'text_rule', 'متن قوانین', '', 1, 0, 1, 'longtext'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'text_rule' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`)
|
||||
SELECT 'text_about', 'متن درباره ما', '', 1, 0, 1, 'longtext'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'text_about' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`)
|
||||
SELECT 'zaarbox_api_url', 'آدرس API تابلو Zaarbox', '', 1, 0, 1, 'text'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'zaarbox_api_url' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`)
|
||||
SELECT 'zaarbox_price_key', 'شناسه ردیف تابلو (key یا UUID)', '', 1, 0, 1, 'text'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'zaarbox_price_key' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`)
|
||||
SELECT 'main_product', 'محصول آبشده', '', 1, 0, 1, 'text'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'main_product' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `title_fa`, `value`, `can_edit`, `is_exist`, `is_active`, `type`)
|
||||
SELECT 'profit_gold_api_enabled', 'API سود طلا', 'false', 1, 0, 0, 'switch'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'profit_gold_api_enabled' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`)
|
||||
SELECT 'unit', '', 'واحد وزن دارایی و معاملات', 1, 1,
|
||||
'واحد نمایش وزن فلز در داراییها، کیف پول و تراکنشها|گرم,کیلوگرم', 'select'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'unit' LIMIT 1);
|
||||
|
||||
INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`)
|
||||
SELECT 'main_wallet_products', '', 'محصولات متصل به کیف اصلی', 0, 1,
|
||||
'idهای محصول با کاما (مثل 13,25). موجودی = gold کیف اصلی. خالی = غیرفعال'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'main_wallet_products' LIMIT 1);
|
||||
|
||||
UPDATE `settings` SET `can_edit` = 0 WHERE `key` = 'main_wallet_products';
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- const — کلیدهای اضافی
|
||||
-- ---------------------------------------------------------------------------
|
||||
INSERT INTO `const` (`key`, `value`, `title_fa`)
|
||||
SELECT 'limited_price', '', 'سقف واریز اولیه'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'limited_price' LIMIT 1);
|
||||
|
||||
INSERT INTO `const` (`key`, `value`, `title_fa`)
|
||||
SELECT 'is_gateway_open', 'true', 'باز بودن درگاه پرداخت'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'is_gateway_open' LIMIT 1);
|
||||
|
||||
INSERT INTO `const` (`key`, `value`, `title_fa`)
|
||||
SELECT 'header_banner', '', 'بنر بالای صفحه'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'header_banner' LIMIT 1);
|
||||
|
||||
INSERT INTO `const` (`key`, `value`, `title_fa`)
|
||||
SELECT 'last_order_log', '', 'لاگ آخرین سفارش همکار'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'last_order_log' LIMIT 1);
|
||||
|
||||
INSERT INTO `const` (`key`, `value`, `title_fa`)
|
||||
SELECT 'liman', '', 'توکن لیمان (legacy)'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `const` WHERE `key` = 'liman' LIMIT 1);
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- پاکسازی کلیدهای legacy / تست
|
||||
-- ---------------------------------------------------------------------------
|
||||
DELETE FROM `settings` WHERE `key` IN (
|
||||
'test', 'test2', 'test22', 'test3', 'test33', 'longtest', 'longtest2',
|
||||
'is_requaire_referral', 'send_to_goldir', 'goldir_price', 'liman_token',
|
||||
'melted_product_id', 'display_montzar'
|
||||
);
|
||||
|
||||
DELETE FROM `const` WHERE `key` = 'log' OR `key` LIKE 'goldir%';
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- metadata — description و type
|
||||
-- ---------------------------------------------------------------------------
|
||||
UPDATE `settings` SET `description` = NULL
|
||||
WHERE LOWER(TRIM(COALESCE(`description`, ''))) IN ('true', 'false', '0', '1', 'yes', 'no', 'in server')
|
||||
OR TRIM(COALESCE(`description`, '')) LIKE 'count of%';
|
||||
|
||||
UPDATE `settings` SET `description` = 'منبع فعال قیمت|montzar,zaarbox,main_product,taban_gohar,etehadie'
|
||||
WHERE `key` = 'price_provider';
|
||||
|
||||
UPDATE `settings` SET `description` = 'required = اجباری|required,', `title_fa` = 'کد معرف', `type` = 'select'
|
||||
WHERE `key` = 'referral_id';
|
||||
|
||||
UPDATE `settings` SET `description` = 'جایگزین: price_provider=main_product' WHERE `key` = 'main_product_price';
|
||||
UPDATE `settings` SET `description` = 'true یا price_provider=montzar' WHERE `key` = 'montzar_price';
|
||||
UPDATE `settings` SET `description` = 'تعداد سفارش اول بدون کارمزد' WHERE `key` = 'fee_free';
|
||||
UPDATE `settings` SET `description` = 'id یا reading_method محصول آبشده' WHERE `key` = 'main_product';
|
||||
|
||||
UPDATE `settings` SET
|
||||
`title_fa` = 'شناسه پشتیبانی پیامرسان',
|
||||
`can_edit` = 1,
|
||||
`type` = 'text',
|
||||
`description` = 'بله: یوزرنیم ble.ir | تلگرام: یوزرنیم | واتساپ: شماره با کد کشور | روبیکا/ایتا/سروش: یوزرنیم'
|
||||
WHERE `key` = 'support_messenger_id';
|
||||
|
||||
UPDATE `settings` SET
|
||||
`title_fa` = 'متن پشتیبانی پیامرسان',
|
||||
`can_edit` = 1,
|
||||
`type` = 'text',
|
||||
`description` = 'متن دکمه یا توضیح پشتیبانی در اپ کاربر'
|
||||
WHERE `key` = 'support_messenger_text';
|
||||
|
||||
UPDATE `settings` SET
|
||||
`title_fa` = 'پیامرسان پشتیبانی',
|
||||
`can_edit` = 1,
|
||||
`type` = 'select',
|
||||
`description` = 'bale,telegram,whatsapp,rubika,eitaa,soroush',
|
||||
`value` = COALESCE(NULLIF(TRIM(`value`), ''), 'bale'),
|
||||
`is_active` = 1
|
||||
WHERE `key` = 'support_messenger';
|
||||
|
||||
UPDATE `settings` SET `is_active` = 1 WHERE `key` IN ('zaarbox_api_url', 'zaarbox_price_key', 'chart_id', 'jibit_verification') AND `is_active` IS NULL;
|
||||
|
||||
UPDATE `const` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'بنر بالای صفحه') WHERE `key` = 'header_banner';
|
||||
UPDATE `const` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'باز بودن درگاه') WHERE `key` = 'is_gateway_open';
|
||||
UPDATE `const` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'سقف واریز اولیه') WHERE `key` = 'limited_price';
|
||||
UPDATE `const` SET `title_fa` = COALESCE(NULLIF(TRIM(`title_fa`), ''), 'لاگ آخرین سفارش') WHERE `key` = 'last_order_log';
|
||||
|
||||
COMMIT;
|
||||
|
||||
SELECT 'deploy_settings_const.sql finished' AS status;
|
||||
|
||||
-- بعد از اجرا (اختیاری):
|
||||
-- SELECT `key`, `title_fa`, `value`, `type`, `is_active` FROM `settings` ORDER BY `key`;
|
||||
-- SELECT `key`, `value`, `title_fa` FROM `const` ORDER BY `key`;
|
||||
Reference in New Issue
Block a user