M240718063040InsertQimallAddonsMchMenu.php 1007 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace addons\Mch\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240718063040InsertQimallAddonsMchMenu
  6. */
  7. class M240718063040InsertQimallAddonsMchMenu extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = <<<SQL
  16. INSERT INTO `qimall_addons_mch_menu`
  17. (`title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`)
  18. VALUES
  19. ('打印日志', '0', 3, 'mch/client/order/print-log', '', 2, 0, 999, NULL, '', 1, 0, 0);
  20. SQL;
  21. $this->execute($sql);
  22. } catch (\Exception $e) {
  23. echo "Error inserting record into qimall_addons_mch_menu: " . $e->getMessage() . "\n";
  24. }
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function safeDown()
  30. {
  31. echo "M240718063039InsertQimallAddonsMchMenu cannot be reverted.\n";
  32. return false;
  33. }
  34. }