20260527110001_create_fee_refund.php 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. use Phinx\Db\Adapter\MysqlAdapter;
  3. use think\migration\Migrator;
  4. class CreateFeeRefund extends Migrator
  5. {
  6. public function change(): void {
  7. $table = $this->table('fee_refund', [
  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('fee_dimension', 'string', ['limit' => 50, 'null' => false, 'default' => '', 'comment' => '费项维度(多选,逗号分隔value):1账户,2卡'])
  18. ->addColumn('card_no', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '卡号(单张填卡ID,多张填卡BIN)'])
  19. ->addColumn('refund_item', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '退款项:1小额手续费,2失败手续费,3开卡手续费,4充值手续费,5退款手续费,6撤销手续费,7销卡退值金额,9其他'])
  20. ->addColumn('refund_item_remark', 'text', ['null' => true, 'comment' => '退款项备注(退款项为其他时必填)'])
  21. ->addColumn('refund_reason', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '退款原因:1约定已过审批,2特殊情况'])
  22. ->addColumn('agreement_no', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '约定审批编号'])
  23. ->addColumn('refund_reason_detail', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '具体退款原因'])
  24. ->addColumn('remark', 'text', ['null' => true, 'comment' => '备注'])
  25. ->addColumn('file_ids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '附件id,id,id'])
  26. // 审批必填字段
  27. ->addColumn('check_status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '审核状态:0待审核,1审核中,2通过,3不通过,4撤销'])
  28. ->addColumn('check_flow_id', 'integer', ['null' => false, 'default' => 0, 'comment' => '审核流程id'])
  29. ->addColumn('check_step_sort', 'integer', ['null' => false, 'default' => 0, 'comment' => '当前审批步骤'])
  30. ->addColumn('check_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '当前审批人ID'])
  31. ->addColumn('check_last_uid', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '上一审批人'])
  32. ->addColumn('check_history_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '历史审批人ID'])
  33. ->addColumn('check_copy_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '抄送人ID'])
  34. ->addColumn('check_time', 'biginteger', ['null' => false, 'default' => 0, 'signed' => false, 'comment' => '审核通过时间'])
  35. // 用户/部门/时间戳
  36. ->addColumn('admin_id', 'integer', ['null' => false, 'default' => 0, 'comment' => '创建人ID'])
  37. ->addColumn('did', 'integer', ['null' => false, 'default' => 0, 'comment' => '创建人部门ID'])
  38. ->addColumn('create_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '创建时间'])
  39. ->addColumn('update_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '更新时间'])
  40. ->addColumn('delete_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '删除时间'])
  41. ->create();
  42. }
  43. }