作者 lyh

gx

@@ -151,7 +151,7 @@ class ComController extends BaseController @@ -151,7 +151,7 @@ class ComController extends BaseController
151 $currentDateTime = Carbon::now(); 151 $currentDateTime = Carbon::now();
152 $startTime = $currentDateTime->subMonth()->startOfMonth()->toDateString(); 152 $startTime = $currentDateTime->subMonth()->startOfMonth()->toDateString();
153 // 获取上个月的结束时间 153 // 获取上个月的结束时间
154 - $endTime = $startTime->copy()->endOfMonth()->toDateString(); 154 + $endTime = $currentDateTime->subMonth()->endOfMonth();
155 $pv = DB::table('gl_count') 155 $pv = DB::table('gl_count')
156 ->where(['project_id'=>1]) 156 ->where(['project_id'=>1])
157 ->where('date','>=',$startTime.' 00:00:00') 157 ->where('date','>=',$startTime.' 00:00:00')