M240723104955InsertAddonsStoreMenu.php 986 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use addons\Store\common\models\StoreAdmin;
  4. use yii\db\Migration;
  5. /**
  6. * Class M240723104955InsertAddonsStoreMenu
  7. */
  8. class M240723104955InsertAddonsStoreMenu extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $time = time();
  16. try {
  17. $sql = <<<SQL
  18. INSERT INTO `qimall_addons_store_menu`(`title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES ('客服设置', '0', 8, '', 0, 'store/client/setting/customer', '', 2, 0, 999, NULL, '', 1, $time, $time);
  19. SQL;
  20. $this->execute($sql);
  21. } catch (\Exception $e) {
  22. echo $e->getMessage();die();
  23. }
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function safeDown()
  29. {
  30. echo "M240723104955InsertAddonsStoreMenu cannot be reverted.\n";
  31. return false;
  32. }
  33. }