M250709092644CreateGoodsDescriptionTemplateMenu.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace app\migrations;
  3. use common\models\backend\Menu;
  4. use yii\db\Migration;
  5. /**
  6. * Class M250709092644CreateGoodsDescriptionMenu
  7. */
  8. class M250709092644CreateGoodsDescriptionTemplateMenu extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $data = [
  16. [
  17. 'cate_id' => '2',// 类型[1=平台,2=商城]
  18. 'pid' => '32',
  19. 'title' => '商品说明',
  20. 'route' => 'mall/goods/description-template',
  21. 'icon' => '',
  22. 'authItemChild' => []
  23. ],
  24. ];
  25. Menu::migrateCreateMenu($data);
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function safeDown()
  31. {
  32. return false;
  33. }
  34. /*
  35. // Use up()/down() to run migration code without a transaction.
  36. public function up()
  37. {
  38. }
  39. public function down()
  40. {
  41. echo "M250709092644CreateGoodsDescriptionMenu cannot be reverted.\n";
  42. return false;
  43. }
  44. */
  45. }