现在我有以下查询:
$passed = Deployment::where('created_at', '<=', Carbon::now()->subDays(15)->toDateTimeString())->get();
但现在我想在这样的地方添加第二个:WHERE closed_domain == 0
。
但是我怎样才能将它添加到当前查询中呢?我试过::andWhere 但没有成功...。
最佳答案
您可以在调用 get()
之前继续构建查询。
$passed = Deployment::where('created_at', '<=', Carbon::now()->subDays(15))
->where('closed_domain', 0)
->where(.....)
->get();
关于php - Where + 和 Where from 模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34151611/