Ver Fonte

近一周

shish há 3 semanas atrás
pai
commit
4bdb6ec32f

+ 1 - 0
common/components/constant.php

@@ -18,6 +18,7 @@ class constant
 				['name' => '本月', 'value' => 'thisMonth',],
 				['name' => '上月', 'value' => 'lastMonth',],
 				['name' => '今年', 'value' => 'thisYear',],
+				['name' => '近一周', 'value' => 'last7Days',],
 				['name' => '近30天', 'value' => 'last30Days',],
 				['name' => '自定义', 'value' => 'custom',],
 			],

+ 9 - 0
common/components/dateUtil.php

@@ -56,6 +56,15 @@ class dateUtil
                     $endTime = date("Ymd", mktime(23, 59, 59, 1, 0, date("Y", strtotime('+1 year'))));
                 }
                 break;
+            case 'last7Days':
+                //近一周(含今天)
+                $startTime = date("Y-m-d 00:00:00", strtotime("-6 days"));
+                $endTime = date("Y-m-d 23:59:59");
+                if ($Stat) {
+                    $startTime = date("Ymd", strtotime("-6 days"));
+                    $endTime = date("Ymd");
+                }
+                break;
             case 'last30Days':
                 //近30天(含今天)
                 $startTime = date("Y-m-d 00:00:00", strtotime("-29 days"));

+ 1 - 0
common/components/dict.php

@@ -305,6 +305,7 @@ class dict
             ['name' => '本月', 'value' => 'thisMonth',],
             ['name' => '上月', 'value' => 'lastMonth',],
             ['name' => '今年', 'value' => 'thisYear',],
+            ['name' => '近一周', 'value' => 'last7Days',],
             ['name' => '近30天', 'value' => 'last30Days',],
         ],