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 = [ // 订单数据