roleListen.php 422 B

1234567891011121314151617181920
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\listener;
  4. use app\admin\model\Action;
  5. use app\admin\model\RoleAction;
  6. class roleListen
  7. {
  8. /**
  9. * 事件监听处理
  10. *
  11. * @return mixed
  12. */
  13. public function handle($event)
  14. {
  15. $acction= Action::where(["status"=>1,"is_del"=>0])->column("id");
  16. RoleAction::where(["role_id"=>1])->save(["action_conllect"=>implode(",",$acction)]);
  17. }
  18. }