...
|
...
|
@@ -86,18 +86,19 @@ public class SearchSortHelper { |
|
|
if (StringUtils.isBlank(sortFields)) {
|
|
|
return null;
|
|
|
}
|
|
|
boolean isNewRecPage = searchCommonHelper.isNewRecPage(paramMap);
|
|
|
String[] sortFieldArray = sortFields.split(",");
|
|
|
StringBuilder realOrder = new StringBuilder();
|
|
|
for (String sortField : sortFieldArray) {
|
|
|
if (!orderValues.contains(sortField)) {
|
|
|
continue;
|
|
|
}
|
|
|
realOrder.append("," + this.dealSortField(sortField));
|
|
|
realOrder.append("," + this.dealSortField(sortField,isNewRecPage));
|
|
|
}
|
|
|
return realOrder.toString().replaceFirst(",", "");
|
|
|
}
|
|
|
|
|
|
public String dealSortField(String sortField) {
|
|
|
public String dealSortField(String sortField,boolean isNewRecPage) {
|
|
|
String[] sortParts = sortField.split(":");
|
|
|
String realSortField = sortParts[0];
|
|
|
if (realSortField.contains("activities")) {
|
...
|
...
|
@@ -106,9 +107,9 @@ public class SearchSortHelper { |
|
|
// do nothing
|
|
|
} else if (realSortField.equals("discount")) {
|
|
|
realSortField = "promotionDiscount";
|
|
|
} else if (realSortField.equals("shelve_time")) {
|
|
|
} else if (realSortField.equals("shelve_time") && !isNewRecPage) {//非新品到着的页面最新全部按真实上架时间排序
|
|
|
realSortField = "firstShelveTime";
|
|
|
}else {
|
|
|
} else {
|
|
|
realSortField = CharUtils.underlineToCamelhump(realSortField);
|
|
|
}
|
|
|
if (realSortField.equalsIgnoreCase("score")) {
|
...
|
...
|
|