| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- use Phinx\Db\Adapter\MysqlAdapter;
- use think\migration\Migrator;
- class CreateVccPayment extends Migrator
- {
- public function change(): void {
- $table = $this->table('vcc_payment', [
- 'id' => 'id',
- 'engine' => 'InnoDB',
- 'collation' => 'utf8mb4_general_ci',
- 'comment' => 'VCC返点/提成付款申请表',
- 'auto_id' => true,
- ]);
- $table
- // 业务字段
- ->addColumn('payment_reason', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '付款事由'])
- ->addColumn('amount', 'decimal', ['precision' => 14, 'scale' => 2, 'null' => false, 'default' => 0, 'comment' => '金额'])
- ->addColumn('currency', 'string', ['limit' => 8, 'null' => false, 'default' => '', 'comment' => '币种代码(来自币种管理)'])
- ->addColumn('payment_method', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '付款方式:1现金,2银行卡,3支票,4电汇,5汇票,6贷记,7其他'])
- ->addColumn('payment_date', 'string', ['limit' => 20, 'null' => false, 'default' => '', 'comment' => '付款日期'])
- ->addColumn('bank_account', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => '银行账户'])
- ->addColumn('remark', 'text', ['null' => true, 'comment' => '备注'])
- ->addColumn('file_ids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '附件id,id,id'])
- // 审批必填字段
- ->addColumn('check_status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 0, 'comment' => '审核状态:0待审核,1审核中,2通过,3不通过,4撤销'])
- ->addColumn('check_flow_id', 'integer', ['null' => false, 'default' => 0, 'comment' => '审核流程id'])
- ->addColumn('check_step_sort', 'integer', ['null' => false, 'default' => 0, 'comment' => '当前审批步骤'])
- ->addColumn('check_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '当前审批人ID'])
- ->addColumn('check_last_uid', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '上一审批人'])
- ->addColumn('check_history_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '历史审批人ID'])
- ->addColumn('check_copy_uids', 'string', ['limit' => 500, 'null' => false, 'default' => '', 'comment' => '抄送人ID'])
- ->addColumn('check_time', 'biginteger', ['null' => false, 'default' => 0, 'signed' => false, 'comment' => '审核通过时间'])
- // 用户/部门/时间戳
- ->addColumn('admin_id', 'integer', ['null' => false, 'default' => 0, 'comment' => '创建人ID'])
- ->addColumn('did', 'integer', ['null' => false, 'default' => 0, 'comment' => '创建人部门ID'])
- ->addColumn('create_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '创建时间'])
- ->addColumn('update_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '更新时间'])
- ->addColumn('delete_time', 'biginteger', ['null' => false, 'default' => 0, 'comment' => '删除时间'])
- ->create();
- }
- }
|