roleListen.php 420 B

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