Code optimization

This commit is contained in:
sunkaixuan
2017-08-28 01:38:33 +08:00
parent 2f1cffebf4
commit 4d964a7c8e
2 changed files with 2 additions and 2 deletions

View File

@@ -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)

View File

@@ -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}";
}
}
}