2026_11_08_170000_add_agent_withdrawal_channels.php 1.4 KB

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