From 49c89961c3511b24d82e3eb985d1d5a073353f32 Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@qq.com> Date: Fri, 2 Feb 2024 17:41:02 +0800 Subject: [PATCH] =?UTF-8?q?=20-=20=E4=BF=AE=E5=A4=8D=20ZeroDbContext=20Gro?= =?UTF-8?q?upBy=20BUG=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ZeroDbContext.SelectImpl.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Extensions/FreeSql.Extensions.ZeroEntity/ZeroDbContext.SelectImpl.cs b/Extensions/FreeSql.Extensions.ZeroEntity/ZeroDbContext.SelectImpl.cs index f5fda6b09..22509c259 100644 --- a/Extensions/FreeSql.Extensions.ZeroEntity/ZeroDbContext.SelectImpl.cs +++ b/Extensions/FreeSql.Extensions.ZeroEntity/ZeroDbContext.SelectImpl.cs @@ -766,7 +766,8 @@ public SelectImpl GroupByRaw(string sql) if (string.IsNullOrWhiteSpace(sql)) return this; _useStates = false; _groupBy = $"{_groupBy}, {sql}"; - _select.GroupBy(_groupBy); + _useStates = false; + _select.GroupBy(_groupBy.Substring(2)); return this; } public SelectImpl GroupBy(string[] fields) @@ -783,7 +784,7 @@ public SelectImpl GroupBy(string[] fields) if (count > 0) { _useStates = false; - _select.GroupBy(_groupBy); + _select.GroupBy(_groupBy.Substring(2)); } return this; }