M240606101037InsertQimallRbacAuthItem.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240606101037InsertQimallRbacAuthItem
  6. */
  7. class M240606101037InsertQimallRbacAuthItem extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. // 添加新记录到qimall_rbac_auth_item表
  15. $this->insert('qimall_rbac_auth_item', [
  16. 'name' => 'admin/role/del',
  17. 'title' => '删除',
  18. 'app_id' => 'backend',
  19. 'addons_name' => '',
  20. 'pid' => 2275,
  21. 'level' => 4,
  22. 'is_addon' => 0,
  23. 'sort' => 9999,
  24. 'tree' => 'tr_0 tr_2278 tr_2262 tr_2275 ',
  25. 'status' => 1,
  26. 'created_at' => time(),
  27. 'updated_at' => time(),
  28. 'cate_id' => 1,
  29. ]);
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function safeDown()
  35. {
  36. // 删除qimall_rbac_auth_item表中的新记录
  37. $this->delete('qimall_rbac_auth_item', ['name' => 'admin/role/del', 'title' => '删除']);
  38. }
  39. }