cqpCow 1 년 전
부모
커밋
9d2152b5af
1개의 변경된 파일1개의 추가작업 그리고 9개의 파일을 삭제
  1. 1 9
      app/Model/Role.php

+ 1 - 9
app/Model/Role.php

@@ -19,7 +19,6 @@ class Role extends Model
     protected $dateFormat = 'U';
     public static $user = [];
     public static $search = [];
-    public static $is_search = false;
     const range_function = '';
 
     public function __construct(array $attributes = [])
@@ -28,15 +27,8 @@ class Role extends Model
             self::$user = $attributes['userData'];
             self::$user['range_function'] = self::range_function;
             self::$search = $attributes['search'] ?? [];
-            self::$is_search = true;
-        }
-        parent::__construct($attributes);
-    }
-
-    protected static function boot(){
-        parent::boot();
-        if(self::$is_search){
             static::addGlobalScope(new DepartmentScope(self::$user,self::$search));
         }
+        parent::__construct($attributes);
     }
 }