记得上下班打卡 | git大法好,push需谨慎

Commit bc1ce400 authored by 胡佳晨's avatar 胡佳晨

商品列表

parent f0d14263
......@@ -75,9 +75,9 @@ public class StoneItemListVo implements Serializable, Cloneable {
this.setPrice(source.getPrice());
LocalDateTime now = LocalDateTime.now();
if (source.getStatus() == 2) {
if (now.isAfter(source.getStartTime())) {//未上架
if (now.isBefore(source.getStartTime())) {//未上架
this.setStatus(2);
} else if (now.isBefore(source.getEndTime())) {//已下架
} else if (now.isAfter(source.getEndTime())) {//已下架
this.setStatus(7);
} else {
this.setStatus(1);//上架中
......
......@@ -154,7 +154,7 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
voList = stoneRedisUtils.getLogsList(uid);
count = voList.size();
} else {
HashMap<String, Object> info = stoneMongoUtils.itemListPage(page, size);
HashMap<String, Object> info = stoneMongoUtils.logList(uid,page, size);
try {
voList = (List<StoneScoreLogs>) info.get("data");
count = (long) info.get("total");
......
......@@ -75,7 +75,7 @@ public class StoneMongoUtils {
// 排序 分页
Pageable pageable = PageRequest.of(page - 1, size, Sort.by(Sort.Direction.DESC, "createdAt"));
//条件
Query query = Query.query(Criteria.where("status").is(1));//.orOperator(Criteria.where("status").is(2).and("startTime").lt(now).and("endTime").gt(now)));
Query query = Query.query(new Criteria().orOperator(Criteria.where("status").is(1),Criteria.where("status").is(2).and("startTime").lte(now).and("endTime").gte(now)));
// 查询总数
long count = mongoTemplate.count(query, StoneScoreItems.class, StoneScoreItems.class.getSimpleName());
query.with(pageable);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment