|
@@ -109,7 +109,7 @@ public class ProductController {
|
|
|
Condition condition = new Condition(StoreProduct.class);
|
|
|
Criteria criteria = condition.createCriteria();
|
|
|
criteria.andEqualTo("isDelete", 0);
|
|
|
- condition.setOrderByClause("create_time DESC");
|
|
|
+ // condition.setOrderByClause("create_time DESC");
|
|
|
if (StringUtils.isNotBlank(dto.getStoreName())) {
|
|
|
criteria.andLike("storeName", "%" + dto.getStoreName() + "%");
|
|
|
}
|
|
@@ -128,6 +128,21 @@ public class ProductController {
|
|
|
if (dto.getMinPrice() != null && dto.getMaxPrice() != null) {
|
|
|
criteria.andBetween("price", dto.getMinPrice(), dto.getMaxPrice());
|
|
|
}
|
|
|
+
|
|
|
+ if (new Integer(0).equals(dto.getSortWay())) {
|
|
|
+ condition.setOrderByClause("create_time desc");
|
|
|
+ } else if (new Integer(1).equals(dto.getSortWay())) {
|
|
|
+ condition.setOrderByClause("price asc");
|
|
|
+ } else if (new Integer(2).equals(dto.getSortWay())) {
|
|
|
+ condition.setOrderByClause("price desc");
|
|
|
+ } else if (new Integer(3).equals(dto.getSortWay())) {
|
|
|
+ condition.setOrderByClause("ficti asc");
|
|
|
+ } else if (new Integer(4).equals(dto.getSortWay())) {
|
|
|
+ condition.setOrderByClause("ficti desc");
|
|
|
+ }else{
|
|
|
+ condition.setOrderByClause("create_time desc");
|
|
|
+ }
|
|
|
+
|
|
|
PageInfo pageInfo = null;
|
|
|
try {
|
|
|
List<StoreProduct> list = storeProductService.findByCondition(condition);
|