From 5873c129e207874b2e0e6ec992ef2676aa5c5819 Mon Sep 17 00:00:00 2001 From: hellcat <> Date: Tue, 6 Jan 2026 18:24:27 +0800 Subject: [PATCH] no message --- src/Models/Node.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Models/Node.php b/src/Models/Node.php index be456ed62..5a9e5f4af 100755 --- a/src/Models/Node.php +++ b/src/Models/Node.php @@ -59,17 +59,13 @@ final class Node extends Model return $sMemoFront; } - public function getDuckClassAttribute() + public function getDuckClassAttribute(): string { - $sLocation = ''; - - if ($this->duck_group) { - $sLocation = $this->duck_group; - } else { - $sLocation = $this->duck_code; - } - - return preg_replace('/[^a-zA-Z\x{4e00}-\x{9fa5}]/u', '', $sLocation ?? ''); + $sLocation = $this->duck_group ?: ($this->duck_code ?? ''); + + $sBeforeDash = strstr($sLocation, '-', true) ?: $sLocation; + + return preg_replace('/\d+/', '', $sBeforeDash); } /**