作者 lyh

gx

... ... @@ -147,11 +147,17 @@ class ComController extends BaseController
}
public function ceshi(){
// 获取上个月的开始时间
$startTime = Carbon::now()->subMonth()->startOfMonth()->toDateString();
// 获取上个月的结束时间
$endTime = Carbon::now()->subMonth()->endOfMonth()->toDateString();
$data = DB::table('gl_customer_visit')
->select('referrer_url', DB::raw('COUNT(*) as count'))
->groupBy('referrer_url')->where(['domain'=>'http://lxl.petuu.shop/'])
->where('updated_date','>=',$startTime->toDateString())
->where('updated_date','<=',$endTime->toDateString())
->orderByDesc('count')->limit(8)->get()->toArray();
return $data;
return json_encode($data);
}
/**
... ...