Merge branch 'test6.8.7' into test6.8.8
Showing
1 changed file
with
4 additions
and
3 deletions
@@ -470,10 +470,11 @@ public class ProductSearchServiceImpl implements ProductSearchService { | @@ -470,10 +470,11 @@ public class ProductSearchServiceImpl implements ProductSearchService { | ||
470 | jo.put("today", ymd); | 470 | jo.put("today", ymd); |
471 | JSONArray yearArray = new JSONArray(); | 471 | JSONArray yearArray = new JSONArray(); |
472 | int year = Integer.parseInt(ymd.substring(0, 4)); | 472 | int year = Integer.parseInt(ymd.substring(0, 4)); |
473 | - for (int y = year - 3; y <= year + 1; y++) { | 473 | + int month = Integer.parseInt(ymd.substring(5, 7)); |
474 | + for (int y = year - 1; y <= year + 1; y++) { | ||
474 | JSONObject yearData = new JSONObject(); | 475 | JSONObject yearData = new JSONObject(); |
475 | JSONArray monthArray = new JSONArray(); | 476 | JSONArray monthArray = new JSONArray(); |
476 | - for (int m = 1; m <= 12; m++) { | 477 | + for (int m = ((y == year - 1)? month:1); m <= ((y == year + 1)?month:12); m++) { |
477 | String ym = y + "-" + (m < 10 ? "0" + m : Integer.toString(m)); | 478 | String ym = y + "-" + (m < 10 ? "0" + m : Integer.toString(m)); |
478 | Integer count = countMap.getInteger(ym); | 479 | Integer count = countMap.getInteger(ym); |
479 | JSONObject ymData = new JSONObject(); | 480 | JSONObject ymData = new JSONObject(); |
@@ -605,5 +606,5 @@ public class ProductSearchServiceImpl implements ProductSearchService { | @@ -605,5 +606,5 @@ public class ProductSearchServiceImpl implements ProductSearchService { | ||
605 | processProductSales(data.getJSONArray("product_list")); | 606 | processProductSales(data.getJSONArray("product_list")); |
606 | } | 607 | } |
607 | return data; | 608 | return data; |
608 | - } | 609 | + } |
609 | } | 610 | } |
-
Please register or login to post a comment