Skip to content

Commit 1a42fa5

Browse files
committed
0.0.12 处理order有关键字时出错的问题
1 parent 717fbb7 commit 1a42fa5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

APIJSON.NET/APIJSON.NET/appsettings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"ConnectionStrings": {
33
"DbType": 0, //0:MySql,1:SqlServer,2:Sqlite
4-
"ConnectionString": "Server=192.168.2.25;Database=yunwei1.8;Uid=root;Pwd=xmjk;Port=3306;Character Set=utf8;"
5-
//"ConnectionString": "Server=119.29.9.25;Port=3306;Database=test;Uid=root;Pwd=1q,2w.3e?;CharSet=UTF8;"
4+
"ConnectionString": "Server=localhost;Port=3306;Database=test;Uid=root;Pwd=test;CharSet=UTF8;"
65
},
76
"CorsUrls": "http://localhost:5000,http://localhost5001",
87
"Authentication": {

APIJSON.NET/APIJSONCommon/ApiJson.Common.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
5-
<Version>0.0.11</Version>
5+
<Version>0.0.12</Version>
66
<Description>
7+
0.0.12 处理order有关键字时出错的问题
78
0.0.11 升级sqlSugarCore版本 解决如果查找字段是关键字(例如:key)时出错的问题
89
0.0.10 处理别名如果为关键字的缺陷
910
0.0.8 清理SelectTable 支持重载

APIJSON.NET/APIJSONCommon/SelectTable.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ private void ProcessColumn(string subtable, string selectrole, JObject values, I
534534
{
535535
throw new Exception("别名不能超过20个字符");
536536
}
537-
str.Append(ziduan[0] + " as `" + ReplaceSQLChar(ziduan[1]) + "`,");
537+
str.Append("`"+ ziduan[0] + "`" + " as `" + ReplaceSQLChar(ziduan[1]) + "`,");
538538
}
539539
else
540540
str.Append("`" + ziduan[0] + "`" + ",");
@@ -645,15 +645,15 @@ private void ProcessOrder(string subtable, JObject values, ISugarQueryable<Expan
645645
{
646646
if (item.EndsWith("-"))
647647
{
648-
tb.OrderBy($"{col} desc");
648+
tb.OrderBy($"`{col}` desc");
649649
}
650650
else if (item.EndsWith("+"))
651651
{
652-
tb.OrderBy($"{col} asc");
652+
tb.OrderBy($"`{col}` asc");
653653
}
654654
else
655655
{
656-
tb.OrderBy($"{col}");
656+
tb.OrderBy($"`{col}`");
657657
}
658658
}
659659
}

0 commit comments

Comments
 (0)