Browse Source

Update core

pull/14/head
sunkaixuan 3 years ago
parent
commit
988e463fbe
  1. 5
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs
  2. 9
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/MySql/SqlBuilder/MySqlQueryBuilder.cs

5
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs

@ -427,7 +427,10 @@ namespace SqlSugar
public virtual string ToCountSql(string sql)
{
if (sql != null && sql.Contains("-- No table"))
{
return "-- No table";
}
return string.Format(" SELECT COUNT(1) FROM ({0}) CountTable ", sql);
}

9
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/MySql/SqlBuilder/MySqlQueryBuilder.cs

@ -71,7 +71,14 @@ namespace SqlSugar
string result = null;
sql = new StringBuilder();
sql.AppendFormat(SqlTemplate, "Count(*)", GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, (Skip != null || Take != null) ? null : GetOrderByString);
if (IsCount) { return sql.ToString(); }
if (IsCount)
{
if (sql.ToString().Contains("-- No table"))
{
return "-- No table";
}
return sql.ToString();
}
if (Skip != null && Take == null)
{
if (this.OrderByValue == "ORDER BY ") this.OrderByValue += GetSelectValue.Split(',')[0];

Loading…
Cancel
Save