12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateteRefundCompensateTable extends Migrator
- {
- /**
- * Change Method.
- *
- * Write your reversible migrations using this method.
- *
- * More information on writing migrations is available here:
- * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
- *
- * The following commands can be used in this method and Phinx will
- * automatically reverse them when rolling back:
- *
- * createTable
- * renameTable
- * addColumn
- * renameColumn
- * addIndex
- * addForeignKey
- *
- * Remember to call "create()" or "update()" and NOT "save()" when working
- * with the Table class.
- */
- public function change()
- {
- $table = $this->table('refund_compensate',array('id' => true,'primary_key' => ['id'],'engine'=>'InnoDB','comment'=>'售后补偿单记录'));
- $table->addColumn('refund_number', 'string',array('limit' => 255,'default'=>'','comment'=>'售后单编号'))
- ->addColumn('order_id', 'integer',array('limit' => 10,'default'=>0,'comment'=>'订单编号'))
- ->addColumn('refund_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'补偿金额'))
- ->addColumn('refund_desc', 'string',array('limit' => 1000,'default'=>'','comment'=>'补偿原因'))
- ->addColumn('order_goods_id', 'integer',array('limit' => 10,'default'=>0,'comment'=>'订单商品id'))
- ->addColumn('images', 'string',array('limit' => 2500,'default'=>'','comment'=>'多图用,分隔'))
- ->addColumn('audit_status_zg', 'integer',array('limit' => 10,'default'=>0,'comment'=>'主管审核状态(0待审核 10已同意 20已拒绝)'))
- ->addColumn('refuse_desc_zg', 'string',array('limit' => 1000,'default'=>'','comment'=>'主管拒绝原因(说明)'))
- ->addColumn('finance_refund', 'integer',array('limit' => 10,'default'=>0,'comment'=>'财务退款状态 0未退款 10已退款'))
- ->addColumn('finance_refund_time', 'integer',array('limit' => 10,'default'=>0,'comment'=>'财务退款时间'))
- ->addColumn('out_refund_no', 'string',array('limit' => 255,'default'=>'','comment'=>'生成退款编号'))
- ->addColumn('status', 'integer',array('limit' => 10,'default'=>0,'comment'=>'状态(0进行中 10已拒绝 20已完成 30 已撤消 40 已关闭)'))
- ->addColumn('create_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '创建时间'))
- ->addColumn('update_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '更新时间'))
- ->addColumn('submit_zy', 'string',array('limit' => 255,'default'=>'','comment'=>'申请专员'))
- ->addColumn('ret_wx_pay', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'补偿到微信支付'))
- ->addColumn('ret_rice_card_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'补偿到米卡'))
- ->create();
- }
- }
|