作者 lyh

gx

... ... @@ -149,13 +149,13 @@ class ComController extends BaseController
public function ceshi(){
$currentDateTime = Carbon::now();
$startTime = $currentDateTime->subMonth()->startOfMonth()->toDateString();
$startTime = $currentDateTime->subMonth()->startOfMonth();
// 获取上个月的结束时间
$endTime = $currentDateTime->subMonth()->endOfMonth();
$endTime = $startTime->copy()->subMonth()->endOfMonth();
$pv = DB::table('gl_count')
->where(['project_id'=>1])
->where('date','>=',$startTime.' 00:00:00')
->where('date','<=',$endTime.' 23:59:59')
->where('date','>=',$startTime->toDateString().' 00:00:00')
->where('date','<=',$endTime->toDateString().' 23:59:59')
->sum('pv_num');
$this->response('success',Code::SUCCESS,$endTime);
}
... ...