From bd43733eee3488035d1d02ff3e9f3cb78372c220 Mon Sep 17 00:00:00 2001 From: Master Date: Thu, 7 Dec 2023 17:04:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=9B=A0=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/Template/Service.cs.vm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/Service.cs.vm b/Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/Service.cs.vm index 4b1edf2ff..45206fd80 100644 --- a/Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/Service.cs.vm +++ b/Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/Service.cs.vm @@ -73,13 +73,14 @@ if (@column.QueryWhether == "Y"){ } @:.Select((@(@joinTableName))=> new @(@Model.ClassName)Output{ @foreach (var column in Model.TableField){ - @:@(@column.PropertyName) = u.@(@column.PropertyName), if(@column.EffectType == "fk"){ + @:@(@column.PropertyName) = u.@(@column.PropertyName), @:@(@column.PropertyName)@(@column.FkColumnName) = @(@column.PropertyName.ToLower()).@(@column.FkColumnName), - } else if(@column.EffectType == "ApiTreeSelect"){ + } else if(@column.EffectType == "ApiTreeSelect"){ + @:@(@column.PropertyName) = u.@(@column.PropertyName), @:@(@column.PropertyName)@(@column.DisplayColumn) = @(@column.PropertyName.ToLower()).@(@column.DisplayColumn), } else if(@column.NetType?.TrimEnd('?').EndsWith("Enum") == true){ - @:@(@column.PropertyName)@(@column.DisplayColumn) = u.@(@column.PropertyName), + @:@(@column.PropertyName) = (@(@column.NetType))u.@(@column.PropertyName), } else { @:@(@column.PropertyName) = u.@(@column.PropertyName), } @@ -112,7 +113,11 @@ if (@column.QueryWhether == "Y"){ } } } - query = query.OrderBuilder(input, "", "CreateTime"); + @if(Model.IsJoinTable){ + @:query = query.OrderBuilder(input, "", "u.CreateTime"); + }else{ + @:query = query.OrderBuilder(input, "", "CreateTime"); + } return await query.ToPagedListAsync(input.Page, input.PageSize); } -- Gitee