laravel查询构建器删除where子句

时间:2018-08-07 11:20:34

标签: laravel-5 eloquent where-clause

我在查询生成器(Laravel 5.6)中有whereIn

$data->whereIn('field1', [1,2,3])->whereIn('field2', [4,5,6])->whereIn('field3', [8,9,10]);
....
$some_count = clone $data;
$result = $data->get();
$count_result = $some_count->count(); <-- need without one of whereIn

现在,我需要在不使用whereIn之一的情况下执行count(),例如“ whereIn('field2',[4,5,6])”。如何从$ some_count中删除此子句?

0 个答案:

没有答案