12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateMemberOrderTable 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()
- {
- $this->table('member_order',array('order_id' => true,'primary_key' => ['order_id'],'engine'=>'InnoDB','comment'=>'米卡订单'))
- ->addColumn('order_no', 'string',array('limit' => 255,'default'=>'','comment'=>'订单号'))
- ->addColumn('user_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'购买者用户id'))
- ->addColumn('user_mobile', 'string',array('limit' => 255,'default'=>'','comment'=>'购买者手机号'))
- ->addColumn('member_cards_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'会员类型id'))
- ->addColumn('member_cards_sale_price', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'促销价'))
- ->addColumn('member_cards_origin_price', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'原价'))
- ->addColumn('pay_price', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'实际支付金额'))
- ->addColumn('pay_status', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'支付状态 0 待支付 1 支付成功 2支付失败'))
- ->addColumn('pay_type', 'integer',array('limit' => 10,'signed'=>false,'default'=>0,'comment'=>'支付方式(10余额支付 20微信支付)'))
- ->addColumn('order_status', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'订单状态(10进行中 20取消 21待取消 30已完成 40已关闭)'))
- ->addColumn('pay_time', 'datetime', array('null' => true,'comment'=>'支付时间'))
- ->addColumn('from_member_time', 'datetime', array('null' => true,'comment'=>'续费开始时间'))
- ->addColumn('to_member_time', 'datetime', array('null' => true,'comment'=>'续费结束时间'))
- ->addColumn('update_time', 'datetime', array('null' => true,'comment'=>'订单更新时间'))
- ->addColumn('create_time', 'datetime', array('null' => true,'comment'=>'订单创建时间'))
- ->addColumn('cancel_time', 'datetime', array('null' => true,'comment'=>'订单取消时间'))
- ->addColumn('cancel_reason', 'string',array('limit' => 255,'default'=>'','comment'=>'取消原因'))
- ->addColumn('remark', 'string',array('limit' => 255,'default'=>'','comment'=>'订单备注'))
- ->addColumn('is_del', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'删除状态 0 未删除 1 已删除'))
- ->addColumn('store_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>10001,'comment'=>'商城ID'))
- ->addColumn('transaction_id', 'string',array('limit' => 255,'default'=>'','comment'=>'微信支付交易流水号'))
- ->create();
- }
- }
|