select
*
from
homework
where
(id between 1 and 10 or id between 50 and 70)
and complete = 1
and (title like 'a%' or title like 'b%');
解决方式
$homeworks = Homework::where(function ($query) {
$query->whereBetween('id', [1, 10])
->orWhereBetween('id', [50, 70]);
})->where('complete', 1)
->where(function ($query) {
$query->where('title', 'like', 'a%')
->orWhere('title', 'like', 'b%');
})->get();