'未确认', 1 => '已确认', ]; public static $user = []; public static $search = []; const range_function = 'invoiceRange'; public function __construct(array $attributes = []) { if(! empty($attributes['userData'])) { self::$user = $attributes['userData']; self::$search = $attributes['search'] ?? []; self::$user['range_function'] = self::range_function; static::addGlobalScope(new DepartmentScope(self::$user, self::$search)); } parent::__construct($attributes); } }