'2',// 类型[1=平台,2=商城] 'pid' => '38', 'title' => '协议设置', 'route' => 'mall/service-agreement/index', 'icon' => '', 'authItemChild' => [// 子菜单权限,此参数若为空则表示无需增加子菜单权限) [ 'title' => '添加/编辑协议', 'name' => 'mall/service-agreement/edit', ], [ 'title' => '删除协议', 'name' => 'mall/service-agreement/del', ], ] ] ]; $res = Menu::migrateCreateMenu($data); if ($res === false) throw new \Exception(Menu::getStaticError()); }catch (\Exception $e){ \Yii::error('迁移错误:' . $e->getMessage()); } } /** * {@inheritdoc} */ public function safeDown() { echo "M230713150123InsertQimallMenu cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M230713150123InsertQimallMenu cannot be reverted.\n"; return false; } */ }