20260525033651_create_price_adjust.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. use Phinx\Db\Adapter\MysqlAdapter;
  3. use think\migration\Migrator;
  4. class CreatePriceAdjust extends Migrator
  5. {
  6. public function change(): void {
  7. $table = $this->table('price_adjust', [
  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('history_fee_deduct', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '历史费用是否需要补扣:0否,1是'])
  18. ->addColumn('trade_scene', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '客户交易主要场景:1广告服务类,2平台电商类,3钱包类,4订阅类,5游戏类,6航空机旅,7留学缴费,8SAAS,9其他'])
  19. ->addColumn('trade_scene_remark', 'text', ['null' => true, 'comment' => '交易场景备注(场景为其他时必填)'])
  20. ->addColumn('card_bin', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '卡BIN:1投流组,2电商组,3Q卡,4A卡,5V卡'])
  21. ->addColumn('card_bin_remark', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '卡BIN备注'])
  22. ->addColumn('card_type', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '卡类型:1储值卡,2共享卡'])
  23. ->addColumn('fee_recharge', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '调整的费项【充值】'])
  24. ->addColumn('fee_card_open', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '调整的费项【开卡】'])
  25. ->addColumn('fee_other', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '调整的其他费项'])
  26. ->addColumn('monthly_trade_vol', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '客户月均整体交易量(万美金)'])
  27. ->addColumn('estimated_trade_vol', 'string', ['limit' => 100, 'null' => false, 'default' => '', 'comment' => '预估切换交易量(万美金)'])
  28. ->addColumn('competitor_info', 'text', ['null' => true, 'comment' => '目前使用的友商名称和报价'])
  29. ->addColumn('remark', 'text', ['null' => true, 'comment' => '备注'])
  30. ->addColumn('file_ids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '附件id,id,id'])
  31. // 审批必填字段
  32. ->addColumn('check_status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '审核状态:0待审核,1审核中,2通过,3不通过,4撤销'])
  33. ->addColumn('check_flow_id', 'integer', ['null' => false, 'default' => 0, 'comment' => '审核流程id'])
  34. ->addColumn('check_step_sort', 'integer', ['null' => false, 'default' => 0, 'comment' => '当前审批步骤'])
  35. ->addColumn('check_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '当前审批人ID'])
  36. ->addColumn('check_last_uid', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '上一审批人'])
  37. ->addColumn('check_history_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '历史审批人ID'])
  38. ->addColumn('check_copy_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '抄送人ID'])
  39. ->addColumn('check_time', 'biginteger', ['null' => false, 'default' => 0, 'signed' => false, 'comment' => '审核通过时间'])
  40. // 用户/部门/时间戳
  41. ->addColumn('admin_id', 'integer', ['null' => false, 'default' => 0, 'comment' => '创建人ID'])
  42. ->addColumn('did', 'integer', ['null' => false, 'default' => 0, 'comment' => '创建人部门ID'])
  43. ->addColumn('create_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '创建时间'])
  44. ->addColumn('update_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '更新时间'])
  45. ->addColumn('delete_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '删除时间'])
  46. ->create();
  47. }
  48. }