📜  laravel 明智地计算数据 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:40.988000             🧑  作者: Mango

代码示例1
$usersData = User::select(DB::raw('DATE(created_at) as date'), DB::raw('count(*) as total'))
            ->groupBy('date')
            ->orderBy('date', 'desc')
            ->take(7)
            ->get();