M220906062142InsertQimallAddonsStoreMenu.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Exception;
  4. use yii\db\Migration;
  5. /**
  6. * Class M220906062142InsertQimallAddonsStoreMenu
  7. */
  8. class M220906062142InsertQimallAddonsStoreMenu extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. try {
  16. $this->execute("INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (31, '赊账', '0', 0, 'store/client/credit/index', '', 3, 0, 999, NULL, '', 1, 0, 0);");
  17. $this->execute("INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (32, '赊账记录', '0', 31, 'store/client/credit/index', '', 3, 0, 999, NULL, '', 1, 0, 0);");
  18. $this->execute("INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (33, '赊账设置', '0', 31, 'store/client/credit/setting-credit', '', 3, 0, 999, NULL, '', 1, 0, 0);");
  19. }catch (Exception $e){
  20. var_dump($e->getMessage());
  21. }
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function safeDown()
  27. {
  28. echo "M220906062142InsertQimallAddonsStoreMenu cannot be reverted.\n";
  29. return false;
  30. }
  31. /*
  32. // Use up()/down() to run migration code without a transaction.
  33. public function up()
  34. {
  35. }
  36. public function down()
  37. {
  38. echo "M220906062142InsertQimallAddonsStoreMenu cannot be reverted.\n";
  39. return false;
  40. }
  41. */
  42. }