作者 lyh

gx

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