📌  相关文章
📜  从父 laravel eloquent 过滤子表数据 - PHP 代码示例

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

代码示例1
$runs = Run::whereHas('times', function ($builder) use ($user) { 
        $query->where('user_id', $user->id);
    })->with(['times' => function ($query) use ($user) {
        $query->where('user_id', $user->id);
    }])->get();