execute($sql); // 获取权限id $itemId = AuthItem::find()->select('id')->where(['title' => '智能标签', 'status' => 1])->scalar(); $rbac_sql = "UPDATE `qimall_rbac_auth_item` SET `level` = 3, `tree` = 'tr_0 tr_2820 tr_{$itemId} ' WHERE `pid` = {$itemId};"; $this->execute($rbac_sql); } catch (\Exception $e) { \Yii::error('智能标签菜单转移:' . $e->getMessage()); } } /** * {@inheritdoc} */ public function safeDown() { echo "M230601165236UpdateQimallMenu cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M230601165236UpdateQimallMenu cannot be reverted.\n"; return false; } */ }