123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateGroupBuyLbActivityHelpTable 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('group_buy_lb_activity_help', array('id' => true, 'primary_key' => ['id'], 'engine' => 'InnoDB', 'comment' => '拼团裂变团员表'))
- ->addColumn('group_buy_lb_activity_id', 'integer', array('limit' => 11, 'signed' => false, 'default' => 0, 'comment' => '拼团活动ID'))
- ->addColumn('join_id', 'integer',array('limit' => 10,'signed'=>false,'default'=>0,'comment'=>'成团id'))
- ->addColumn('user_id', 'integer',array('limit' => 10,'signed'=>false,'default'=>0,'comment'=>'参与用户,假用户为0'))
- ->addColumn('order_no', 'string', array('limit' => 255,'signed' => false, 'default' => 0, 'comment' => '拼团订单号 假用户为空'))
- ->addColumn('pay_state', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '支付状态 0 待支付 1 已支付 2 取消支付. 假用户为1'))
- ->addColumn('pay_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '创建时间'))
- ->addColumn('finance_refund', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '是否退款 0 拼团失败要给用户退款 1 已退款 '))
- ->addColumn('finance_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '退款时间'))
- ->addColumn('order_id', 'integer',array('limit' => 10,'signed'=>true,'default'=>0,'comment'=>'拼团成功写入商品订单id 假用户为0'))
- ->addColumn('goods_num', 'integer',array('limit' => 10,'signed'=>false,'default'=>0,'comment'=>'商品数量'))
- ->addColumn('head_picture', 'string', array('limit' => 255,'signed' => false, 'default' => '', 'comment' => '拼团用户头像 假用户使用系统默认头像'))
- ->addColumn('is_virtual_join_user', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '是否虚拟团发起人,虚拟团不写订单'))
- ->addColumn('fans', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '0真实用户 1假用户'))
- ->addColumn('coupon_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'优惠金额'))
- ->addColumn('rice_card_id', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '支付米卡id'))
- ->addColumn('rice_card_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'米卡抵扣费用'))
- ->addColumn('pay_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'微信支付'))
- ->addColumn('express_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'配送费用'))
- ->addColumn('rice_card_express_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'米卡抵扣运费金额'))
- ->addColumn('order_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'订单总额'))
- ->addColumn('user_name', 'string', array('limit' => 255,'signed' => false, 'default' => '', 'comment' => '收货姓名'))
- ->addColumn('phone', 'string', array('limit' => 255,'signed' => false, 'default' => '', 'comment' => '收货联系方式'))
- ->addColumn('province_id', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '省id'))
- ->addColumn('city_id', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '城市id'))
- ->addColumn('region_id', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '区id'))
- ->addColumn('detail', 'string', array('limit' => 255,'signed' => false, 'default' => '', 'comment' => '详细地址'))
- ->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('provider_ids', 'string', array('limit' => 255,'signed' => false, 'default' => '', 'comment' => '供应商'))
- ->create();
- }
- }
|