作者 lyh

gxdemo脚本

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