M250407172354UpdateRbacAuthItem.php 724 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * 修改素材管理菜单分类为商城
  6. * Class M250407172354UpdateRbacAuthItem
  7. */
  8. class M250407172354UpdateRbacAuthItem extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. try {
  16. $sql = <<<SQL
  17. UPDATE `qimall_rbac_auth_item` SET `cate_id` = 2 WHERE `pid` = 2817 and `name` = 'mall/attachment/index' and `app_id` = 'backend';
  18. SQL;
  19. $this->execute($sql);
  20. } catch (\Exception $e) {
  21. }
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function safeDown()
  27. {
  28. echo "M250407172354UpdateRbacAuthItem cannot be reverted.\n";
  29. return false;
  30. }
  31. }