no message

This commit is contained in:
hellcat 2026-01-06 18:24:27 +08:00
parent d1697e51aa
commit 5873c129e2

View File

@ -59,17 +59,13 @@ final class Node extends Model
return $sMemoFront;
}
public function getDuckClassAttribute()
public function getDuckClassAttribute(): string
{
$sLocation = '';
$sLocation = $this->duck_group ?: ($this->duck_code ?? '');
if ($this->duck_group) {
$sLocation = $this->duck_group;
} else {
$sLocation = $this->duck_code;
}
$sBeforeDash = strstr($sLocation, '-', true) ?: $sLocation;
return preg_replace('/[^a-zA-Z\x{4e00}-\x{9fa5}]/u', '', $sLocation ?? '');
return preg_replace('/\d+/', '', $sBeforeDash);
}
/**