From 8b1b6098721e98ae0f742aae49f20bb5e4280224 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Sun, 21 Apr 2024 21:35:51 +0800 Subject: [PATCH] 1 --- app/api/controller/Data.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/controller/Data.php b/app/api/controller/Data.php index 88cc26b4..4ee3d34f 100644 --- a/app/api/controller/Data.php +++ b/app/api/controller/Data.php @@ -13,9 +13,9 @@ declare (strict_types=1); namespace app\api\controller; +use app\api\service\statistics\Data as StatisticsDataService; use think\db\exception\ModelNotFoundException; use think\response\Json; -use app\api\service\statistics\Data as StatisticsDataService; /** * 数据概况 @@ -49,6 +49,10 @@ class Data extends Controller */ public function statistics($startDate = null, $endDate = null): Json { + if (empty($startDate) || empty($endDate)) { + $startDate = null; + $endDate = null; + } // 获取数据 $data = [ // 订单数据