| 123456789101112131415161718192021222324252627282930 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- /**
- * 代理提现和会员前台一样支持总后台配置的全部提现通道(USDT、人工提现 rgtx、银行卡/支付宝/数字人民币 DF00x、
- * JD、NO、808 等)。通道存在 agent_withdrawals.account_type;三方代付需要记录三方单号和回调。
- * 提现账户沿用 agent_withdraw_accounts:type = 通道,account = 卡号/地址,bank_name,details 存开户行/收款码等。
- */
- return new class extends Migration {
- public function up(): void
- {
- Schema::table('agent_withdrawals', function (Blueprint $t) {
- if (!Schema::hasColumn('agent_withdrawals', 'pay_no')) $t->string('pay_no', 64)->nullable()->index()->comment('三方代付单号');
- if (!Schema::hasColumn('agent_withdrawals', 'pay_data')) $t->text('pay_data')->nullable()->comment('三方代付下单返回');
- if (!Schema::hasColumn('agent_withdrawals', 'callback_data')) $t->text('callback_data')->nullable()->comment('三方代付回调');
- });
- }
- public function down(): void
- {
- Schema::table('agent_withdrawals', function (Blueprint $t) {
- foreach (['pay_no', 'pay_data', 'callback_data'] as $column) {
- if (Schema::hasColumn('agent_withdrawals', $column)) $t->dropColumn($column);
- }
- });
- }
- };
|