M230530142836AlertQimallDoubleCopyLevelOrSetting.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace addons\DoubleCopy\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230530142836AlertQimallDoubleCopyLevelOrSetting
  6. */
  7. class M230530142836AlertQimallDoubleCopyLevelOrSetting extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "ALTER TABLE `qimall_addons_double_copy_level_setting`
  15. ADD COLUMN `indirect_prize_type` tinyint(4) NULL DEFAULT 0 COMMENT '间推奖类型 0百分比 1 固定金额',
  16. ADD COLUMN `indirect_prize` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '间推奖励';
  17. ALTER TABLE `qimall_addons_double_copy_commission_item_setting_detail`
  18. ADD COLUMN `indirect_prize` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '间推奖';";
  19. $sql .= "INSERT INTO `qimall_global_var_map`(`name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ('indirect_prize', '间推奖', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);";
  20. $this->execute($sql);
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. echo "M230530142836AlertQimallDoubleCopyLevelOrSetting cannot be reverted.\n";
  28. return false;
  29. }
  30. /*
  31. // Use up()/down() to run migration code without a transaction.
  32. public function up()
  33. {
  34. }
  35. public function down()
  36. {
  37. echo "M230530142836AlertQimallDoubleCopyLevelOrSetting cannot be reverted.\n";
  38. return false;
  39. }
  40. */
  41. }