Browse Source

Code optimization

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
4d964a7c8e
  1. 2
      Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs
  2. 2
      Src/Asp.Net/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerQueryBuilder.cs

2
Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs

@ -238,7 +238,7 @@ namespace SqlSugar
string orderByValue = (!isRowNumber && this.OrderByValue.IsValuable()) ? GetOrderByString : null;
if (this.IsCount) { orderByValue = null; }
sql.AppendFormat(SqlTemplate, GetSelectValue, GetTableNameString, GetWhereValueString, groupByValue, orderByValue);
sql.Replace("{$:OrderByString:$}", isRowNumber ? (this.IsCount ? null : rowNumberString) : null);
sql.Replace(UtilConstants.OrderReplace, isRowNumber ? (this.IsCount ? null : rowNumberString) : null);
if (this.IsCount) { return sql.ToString(); }
var result = ToPageSql(sql.ToString(), this.Take, this.Skip);
if (ExternalPageIndex > 0)

2
Src/Asp.Net/SqlSugar/Realization/SqlServer/SqlBuilder/SqlServerQueryBuilder.cs

@ -12,7 +12,7 @@ namespace SqlSugar
{
get
{
return "SELECT {0}{{$:OrderByString:$}} FROM {1}{2}{3}{4}";
return "SELECT {0}{"+UtilConstants.OrderReplace+"} FROM {1}{2}{3}{4}";
}
}
}

Loading…
Cancel
Save