FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

不对函数加``,解决sum(*),Count(1)等不能使用的问题 by 390620652 · Pull Request #34 · liaozb/APIJSON.NET · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cs  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
9 changes: 7 additions & 2 deletions APIJSON.NET/APIJSON.Data/SelectTable.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public virtual JObject QuerySingle(JObject queryObj, string nodeName = "infos")
{
ExecFunc(resultObj, item);
}
else if (key.Equals("total@"))
else if (key.Equals("total@")|| key.Equals("total"))
{
resultObj.Add("total", total);
}
Expand Down Expand Up @@ -196,7 +196,7 @@ public virtual JObject Query(JObject queryObj)
{
ExecFunc(resultObj, item);
}
else if (key.Equals("total@"))
else if (key.Equals("total@")|| key.Equals("total"))
{
resultObj.Add("total", total);
}
Expand Down Expand Up @@ -535,6 +535,11 @@ private void ProcessColumn(string subtable, string selectrole, JObject values, I
}
str.Append(ziduan[0] + " as `" + ReplaceSQLChar(ziduan[1]) + "`,");
}
//不对函数加``,解决sum(*),Count(1)等不能使用的问题
else if (ziduan[0].Contains('('))
{
str.Append(ziduan[0] + ",");
}
else
str.Append("`" + ziduan[0] + "`" + ",");

Expand Down

Back | FazBrowse Home | New Git URL