|
...
|
...
|
@@ -64,10 +64,13 @@ class MonthReportController extends BaseController |
|
|
|
if(!empty($info['country'])){
|
|
|
|
$info['country'] = json_decode($info['country']);
|
|
|
|
}
|
|
|
|
// 获取上个月的开始时间
|
|
|
|
$startTime = Carbon::now()->subMonth()->startOfMonth()->toDateString();
|
|
|
|
// 获取上个月的结束时间
|
|
|
|
$endTime = Carbon::now()->subMonth()->endOfMonth()->toDateString();
|
|
|
|
// 创建指定年月的 DateTime 对象
|
|
|
|
$date = $this->map['month'];
|
|
|
|
$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');
|
|
|
|
$endTime = $end->format('Y-m-d H:i:s');
|
|
|
|
$param = [
|
|
|
|
'date' => ['between',[$startTime,$endTime]],
|
|
|
|
'project_id' => $this->user['project_id']
|
...
|
...
|
|