20260527100001_create_withdraw.php 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use Phinx\Db\Adapter\MysqlAdapter;
  3. use think\migration\Migrator;
  4. class CreateWithdraw extends Migrator
  5. {
  6. public function change(): void {
  7. $table = $this->table('withdraw', [
  8. 'id' => 'id',
  9. 'engine' => 'InnoDB',
  10. 'collation' => 'utf8mb4_general_ci',
  11. 'comment' => '提现申请表',
  12. 'auto_id' => true,
  13. ]);
  14. $table
  15. // 业务字段
  16. ->addColumn('customer_id', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '客户ID'])
  17. ->addColumn('trade_scene', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '客户交易场景:1Facebook,9其他'])
  18. ->addColumn('trade_scene_remark', 'text', ['null' => true, 'comment' => '交易场景备注(场景为其他时必填)'])
  19. ->addColumn('withdraw_type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '提现类型:1清退提现(全额提现),2部分提现'])
  20. ->addColumn('withdraw_fee', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '提现手续费'])
  21. ->addColumn('is_urgent', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '是否加急处理:0否(按系统周期),1是(人工核算)'])
  22. ->addColumn('remark', 'text', ['null' => true, 'comment' => '备注'])
  23. ->addColumn('file_ids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '附件id,id,id'])
  24. // 审批必填字段
  25. ->addColumn('check_status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '审核状态:0待审核,1审核中,2通过,3不通过,4撤销'])
  26. ->addColumn('check_flow_id', 'integer', ['null' => false, 'default' => 0, 'comment' => '审核流程id'])
  27. ->addColumn('check_step_sort', 'integer', ['null' => false, 'default' => 0, 'comment' => '当前审批步骤'])
  28. ->addColumn('check_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '当前审批人ID'])
  29. ->addColumn('check_last_uid', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '上一审批人'])
  30. ->addColumn('check_history_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '历史审批人ID'])
  31. ->addColumn('check_copy_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '抄送人ID'])
  32. ->addColumn('check_time', 'biginteger', ['null' => false, 'default' => 0, 'signed' => false, 'comment' => '审核通过时间'])
  33. // 用户/部门/时间戳
  34. ->addColumn('admin_id', 'integer', ['null' => false, 'default' => 0, 'comment' => '创建人ID'])
  35. ->addColumn('did', 'integer', ['null' => false, 'default' => 0, 'comment' => '创建人部门ID'])
  36. ->addColumn('create_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '创建时间'])
  37. ->addColumn('update_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '更新时间'])
  38. ->addColumn('delete_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '删除时间'])
  39. ->create();
  40. }
  41. }