M240815092301OperationStoreClerkAddonsMenu.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240815092301OperationStoreClerkAddonsMenu
  6. */
  7. class M240815092301OperationStoreClerkAddonsMenu extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. // 新增商品核销明细菜单,及修改核销明细为电子券核销明细、核销收益为电子券核销收益
  15. $sql = <<<SQL
  16. 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', 105, 'Clerk', 1, 'store/clerk/index/store-goods-clerk-log', '', 2, 0, 999, NULL, '', 1, 0, 0);
  17. UPDATE `qimall_addons_store_menu` SET `title` = '电子券核销明细' WHERE `url` = 'store/clerk/index/clerk-log';
  18. UPDATE `qimall_addons_store_menu` SET `title` = '电子券核销收益' WHERE `url` = 'store/clerk/index/clerk-income';
  19. SQL;
  20. $this->execute($sql);
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. return false;
  28. }
  29. /*
  30. // Use up()/down() to run migration code without a transaction.
  31. public function up()
  32. {
  33. }
  34. public function down()
  35. {
  36. echo "M240815092301OperationStoreClerkAddonsMenu cannot be reverted.\n";
  37. return false;
  38. }
  39. */
  40. }