From a164def0cd48f1df856286909143c764a0eedd3f Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Tue, 11 Mar 2025 14:32:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dao/shell.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dao/shell.go b/dao/shell.go index 39d78ec..8d1c5bd 100644 --- a/dao/shell.go +++ b/dao/shell.go @@ -50,9 +50,9 @@ func FindShellByID(id, uid uint) []Shell { func FindShellByAuthID(auth_id int) []Shell { var shells []Shell if proto.Config.SERVER_SQL_LOG { - DB.Debug().Exec("select * from shells where auth_id = ? order by created_at desc limit 100", auth_id).Scan(&shells) + DB.Debug().Where("auth_id = ?", auth_id).Order("created_at DESC").Limit(100).Find(&shells) } else { - DB.Exec("select * from shells where auth_id = ? order by created_at desc limit 100", auth_id).Scan(&shells) + DB.Where("auth_id = ?", auth_id).Order("created_at DESC").Limit(100).Find(&shells) } return shells }