M220920074446QimallAddonsDoubleCopyPoolSend.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace addons\DoubleCopy\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M220920074446QimallAddonsDoubleCopyPoolSend
  6. */
  7. class M220920074446QimallAddonsDoubleCopyPoolSend extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "CREATE TABLE `qimall_addons_double_copy_pool_send` (
  15. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  16. `mall_id` int(10) NOT NULL DEFAULT '0' COMMENT '商城ID',
  17. `level` int(10) NOT NULL DEFAULT '0' COMMENT '等级(权重)',
  18. `total_bonus_money` decimal(12,2) DEFAULT '0.00' COMMENT '本次分红总额,单位:元',
  19. `bonus_num` int(10) DEFAULT '0' COMMENT '分红人数',
  20. `bonus_money` decimal(12,2) DEFAULT '0.00' COMMENT '每人可得分红金额,单位:元',
  21. `cycle_type` int(10) NOT NULL DEFAULT '0' COMMENT '分红周期[1=日,2=周,3=月]',
  22. `date` int(6) NOT NULL DEFAULT '0' COMMENT '执行日期,如:20220919',
  23. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
  24. `created_at` int(10) DEFAULT '0' COMMENT '创建时间',
  25. `updated_at` int(10) DEFAULT '0' COMMENT '更新时间',
  26. PRIMARY KEY (`id`) USING BTREE,
  27. KEY `mall_level` (`mall_id`,`level`) USING BTREE
  28. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='二二复制分红池发放记录';";
  29. $this->execute($sql);
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function safeDown()
  35. {
  36. echo "M220920074446QimallAddonsDoubleCopyPoolSend cannot be reverted.\n";
  37. return false;
  38. }
  39. /*
  40. // Use up()/down() to run migration code without a transaction.
  41. public function up()
  42. {
  43. }
  44. public function down()
  45. {
  46. echo "M220920074446QimallAddonsDoubleCopyPoolSend cannot be reverted.\n";
  47. return false;
  48. }
  49. */
  50. }