20251109121623_profit_share_receiver.php 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. final class ProfitShareReceiver extends AbstractMigration
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
  13. *
  14. * Remember to call "create()" or "update()" and NOT "save()" when working
  15. * with the Table class.
  16. */
  17. public function change(): void
  18. {
  19. $this->table('profit_share_receiver', ['comment' => '分账接收方'])
  20. ->addColumn('user_id', 'integer', ['null' => false, 'signed' => false, 'comment' => '用户ID'])
  21. ->addColumn('order_no', 'string', ['null' => false, 'limit' => 22, 'comment' => '订单编号'])
  22. ->addColumn('org_code', 'string', ['null' => false, 'limit' => 32, 'comment' => '机构编号'])
  23. ->addColumn('receiver_name', 'string', ['null' => false, 'limit' => 64, 'comment' => '分账接收方名称'])
  24. ->addColumn('contact_mobile', 'string', ['null' => false, 'limit' => 16, 'comment' => '联系手机号'])
  25. ->addColumn('acct_no', 'string', ['null' => false, 'limit' => 32, 'comment' => '收款账户卡号'])
  26. ->addColumn('acct_name', 'string', ['null' => false, 'limit' => 32, 'comment' => '收款账户名称'])
  27. ->addColumn('acct_type_code', 'string', ['null' => false, 'limit' => 32, 'default' => '58', 'comment' => '收款账户账户类型(57:对公 58:对私)'])
  28. ->addColumn('acct_certificate_type', 'string', ['null' => false, 'limit' => 32, 'default' => '17', 'comment' => '收款账户证件类型 17 身份证,18 护照,19 港澳居民来往内地通行证 20 台湾居民来往内地通行证'])
  29. ->addColumn('acct_certificate_no', 'string', ['null' => false, 'limit' => 32, 'comment' => '收款账户证件号'])
  30. ->addColumn('acct_open_bank_code', 'string', ['null' => true, 'limit' => 32, 'comment' => '收款账户开户行号'])
  31. ->addColumn('acct_open_bank_name', 'string', ['null' => false, 'limit' => 64, 'comment' => '收款账户开户行名称'])
  32. ->addColumn('acct_clear_bank_code', 'string', ['null' => true, 'limit' => 32, 'comment' => '收款账户清算行行号'])
  33. ->addColumn('settle_type', 'string', ['null' => false, 'limit' => 32, 'default' => '01', 'comment' => '提款类型 01:主动提款 03:交易自动结算'])
  34. ->addColumn('org_id', 'string', ['null' => true, 'limit' => 32, 'comment' => '接收方所属机构'])
  35. ->addColumn('org_name', 'string', ['null' => true, 'limit' => 32, 'comment' => '接收方所属机构名称'])
  36. ->addColumn('receiver_no', 'string', ['null' => true, 'limit' => 32, 'comment' => '接收方编号'])
  37. ->addColumn('status', 'integer', ['signed' => false, 'default' => 1, 'comment' => '状态 1: 待审核 2:提交中 3: 验证通过 4: 验证失败 5:绑定中 6: 绑定成功 7: 绑定失败'])
  38. ->addColumn('fail_reason', 'string', ['null' => true, 'limit' => 255, 'comment' => '失败原因'])
  39. ->addColumn('entrust_file_name', 'string', ['null' => true, 'limit' => 32, 'comment' => '合作协议附件名称'])
  40. ->addColumn('entrust_file_path', 'string', ['null' => true, 'limit' => 32, 'comment' => '合作协议附件路径'])
  41. ->addColumn('entrust_local_path', 'string', ['null' => true, 'limit' => 32, 'comment' => '合作协议附件本地路径'])
  42. ->addColumn('wallet_id', 'string', ['null' => true, 'limit' => 32, 'comment' => '钱包ID'])
  43. ->addTimestamps('create_time', 'update_time')
  44. ->addColumn('delete_time', 'timestamp', ['null' => true, 'comment' => '删除时间'])
  45. ->addIndex('user_id', ['name' => 'idx_user_id'])
  46. ->addIndex('order_no', ['name' => 'idx_order_no', 'unique' => true])
  47. ->create();
  48. }
  49. }