20220607022723_create_group_buy_lb_activity_help_table.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateGroupBuyLbActivityHelpTable extends Migrator
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  13. *
  14. * The following commands can be used in this method and Phinx will
  15. * automatically reverse them when rolling back:
  16. *
  17. * createTable
  18. * renameTable
  19. * addColumn
  20. * renameColumn
  21. * addIndex
  22. * addForeignKey
  23. *
  24. * Remember to call "create()" or "update()" and NOT "save()" when working
  25. * with the Table class.
  26. */
  27. public function change()
  28. {
  29. $this->table('group_buy_lb_activity_help', array('id' => true, 'primary_key' => ['id'], 'engine' => 'InnoDB', 'comment' => '拼团裂变团员表'))
  30. ->addColumn('group_buy_lb_activity_id', 'integer', array('limit' => 11, 'signed' => false, 'default' => 0, 'comment' => '拼团活动ID'))
  31. ->addColumn('join_id', 'integer',array('limit' => 10,'signed'=>false,'default'=>0,'comment'=>'成团id'))
  32. ->addColumn('user_id', 'integer',array('limit' => 10,'signed'=>false,'default'=>0,'comment'=>'参与用户,假用户为0'))
  33. ->addColumn('order_no', 'string', array('limit' => 255,'signed' => false, 'default' => 0, 'comment' => '拼团订单号 假用户为空'))
  34. ->addColumn('pay_state', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '支付状态 0 待支付 1 已支付 2 取消支付. 假用户为1'))
  35. ->addColumn('pay_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '创建时间'))
  36. ->addColumn('finance_refund', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '是否退款 0 拼团失败要给用户退款 1 已退款 '))
  37. ->addColumn('finance_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '退款时间'))
  38. ->addColumn('order_id', 'integer',array('limit' => 10,'signed'=>true,'default'=>0,'comment'=>'拼团成功写入商品订单id 假用户为0'))
  39. ->addColumn('goods_num', 'integer',array('limit' => 10,'signed'=>false,'default'=>0,'comment'=>'商品数量'))
  40. ->addColumn('head_picture', 'string', array('limit' => 255,'signed' => false, 'default' => '', 'comment' => '拼团用户头像 假用户使用系统默认头像'))
  41. ->addColumn('is_virtual_join_user', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '是否虚拟团发起人,虚拟团不写订单'))
  42. ->addColumn('fans', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '0真实用户 1假用户'))
  43. ->addColumn('coupon_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'优惠金额'))
  44. ->addColumn('rice_card_id', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '支付米卡id'))
  45. ->addColumn('rice_card_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'米卡抵扣费用'))
  46. ->addColumn('pay_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'微信支付'))
  47. ->addColumn('express_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'配送费用'))
  48. ->addColumn('rice_card_express_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'米卡抵扣运费金额'))
  49. ->addColumn('order_money', 'decimal',array('limit' => 11,'precision'=>10,'scale'=>2,'signed'=>false,'default'=>0,'comment'=>'订单总额'))
  50. ->addColumn('user_name', 'string', array('limit' => 255,'signed' => false, 'default' => '', 'comment' => '收货姓名'))
  51. ->addColumn('phone', 'string', array('limit' => 255,'signed' => false, 'default' => '', 'comment' => '收货联系方式'))
  52. ->addColumn('province_id', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '省id'))
  53. ->addColumn('city_id', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '城市id'))
  54. ->addColumn('region_id', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '区id'))
  55. ->addColumn('detail', 'string', array('limit' => 255,'signed' => false, 'default' => '', 'comment' => '详细地址'))
  56. ->addColumn('create_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '创建时间'))
  57. ->addColumn('update_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '更新时间'))
  58. ->addColumn('provider_ids', 'string', array('limit' => 255,'signed' => false, 'default' => '', 'comment' => '供应商'))
  59. ->create();
  60. }
  61. }