作者 lyh

gxdemo脚本

... ... @@ -66,7 +66,7 @@ class MonthReportController extends BaseController
}
// 创建指定年月的 DateTime 对象
$date = $this->map['month'];
$start = new DateTime("$date-01 00:00:00");
$start = new \DateTime("$date-01 00:00:00");
// 克隆 $start 对象并设置到下个月的第一天,减去1秒得到该月的最后一秒
$end = (clone $start)->modify('last day of this month')->setTime(23, 59, 59);
$startTime = $start->format('Y-m-d H:i:s');
... ...