优化获取秒杀活动
This commit is contained in:
parent
ed976e90dc
commit
40bf6d3010
@ -339,7 +339,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl<SeckillApplyMapper, Sec
|
|||||||
Arrays.sort(hoursSored);
|
Arrays.sort(hoursSored);
|
||||||
for (int i = 0; i < hoursSored.length; i++) {
|
for (int i = 0; i < hoursSored.length; i++) {
|
||||||
SeckillTimelineVO tempTimeline = new SeckillTimelineVO();
|
SeckillTimelineVO tempTimeline = new SeckillTimelineVO();
|
||||||
boolean hoursSoredHour = (hoursSored[i] >= hour || ((i + 1) < hoursSored.length && hoursSored[i + 1] > hour) || hoursSored.length == 1);
|
boolean hoursSoredHour = (hoursSored[i] >= hour || i + 1 == hoursSored.length);
|
||||||
if (hoursSoredHour) {
|
if (hoursSoredHour) {
|
||||||
SimpleDateFormat format = new SimpleDateFormat(DatePattern.NORM_DATE_PATTERN);
|
SimpleDateFormat format = new SimpleDateFormat(DatePattern.NORM_DATE_PATTERN);
|
||||||
String date = format.format(new Date());
|
String date = format.format(new Date());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user