M220923063121AddColumnToQimallAddonsAgentLevel.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace addons\Agent\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M220923063121AddColumnToQimallAddonsAgentLevel
  6. */
  7. class M220923063121AddColumnToQimallAddonsAgentLevel extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql="ALTER TABLE qimall_addons_agent_level add is_open_equal_settle_type tinyint(1) DEFAULT 0 COMMENT '开启独立平级奖结算';";
  16. $this->execute($sql);
  17. $sql = "ALTER TABLE qimall_addons_agent_level add equal_settle_type tinyint(1) DEFAULT 0 COMMENT '平级奖结算方式';";
  18. $this->execute($sql);
  19. }catch (\Exception $e){
  20. }
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. echo "M220923063121AddColumnToQimallAddonsAgentLevel 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 "M220923063121AddColumnToQimallAddonsAgentLevel cannot be reverted.\n";
  38. return false;
  39. }
  40. */
  41. }