Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

zhaoxian 6 bulan lalu
induk
melakukan
29adc765e0

+ 7 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KwaiXiaoDianReportController.java

@@ -199,7 +199,7 @@ public class KwaiXiaoDianReportController {
 
 
     @GetMapping("/getGmvHours")
-    public JSONObject getGmvHours(Long userId, Long companyId) {
+    public JSONObject getGmvHours(Long userId, Long companyId, Integer hourType) {
         JSONObject returnJson = new JSONObject();
         try {
             if (Check.isNull(userId)) {
@@ -249,7 +249,12 @@ public class KwaiXiaoDianReportController {
             String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
             requestMap.put("date", DateUtils.strDateToInt(nowDate));
             List<JSONObject> today = kwaiXiaoDianReportService.getGmvHours(requestMap);
-            String lastDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);  //  日期 -1
+            String lastDate = null;
+            if (hourType == 1) {
+                 lastDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);  //  日期 -1
+            } else if (hourType == 2) {
+                 lastDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -7);  //  日期 -7
+            }
             requestMap.put("date", DateUtils.strDateToInt(lastDate));
             List<JSONObject> yesterday = kwaiXiaoDianReportService.getGmvHours(requestMap);
             JSONObject data = new JSONObject();

+ 3 - 1
ruixuan-live/src/main/resources/mapper/isc/KwaiXiaoDianReportMapper.xml

@@ -205,7 +205,9 @@
 
     </select>
     <select id="getGmvHours" resultType="com.alibaba.fastjson.JSONObject">
-        select stat_hour as 'time',
+        select
+        date_format(stat_date, '%m%d') as 'date',
+        stat_hour as 'time',
         round(sum(case
         when status != 80 and status != 10 then total_fee
         else 0 end) / 100,