From 3b90d97f022891113962571e69a0495eebb10ffb Mon Sep 17 00:00:00 2001 From: lizhuoran <625237490@qq.com> Date: Mon, 9 Mar 2026 10:59:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=98=B6=E6=AE=B5=E4=B8=89):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=BB=88=E7=AB=AF=E7=9F=A5=E8=AF=86=E5=BA=93=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 Terminal 模型中添加 knowledgeBases 关联关系 - 在 TerminalResource 表单中添加知识库关联选择器 - 使用 Repeater 组件实现多选和优先级管理 - 支持搜索、拖拽排序、防重复选择 - 自动保存和加载关联数据 --- app/Models/Terminal.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Models/Terminal.php b/app/Models/Terminal.php index 7b53dec..def5544 100644 --- a/app/Models/Terminal.php +++ b/app/Models/Terminal.php @@ -72,7 +72,17 @@ class Terminal extends Model */ public function syncLogs() { - return $this->hasMany(TerminalSyncLog::class); + return $this->hasMany(TerminalSyncLog::class)->orderBy('created_at', 'desc'); + } + + /** + * 获取终端的最新同步日志 + * + * @return \Illuminate\Database\Eloquent\Relations\HasOne + */ + public function latestSyncLog() + { + return $this->hasOne(TerminalSyncLog::class)->latestOfMany(); } /**