【发布时间】:2019-08-14 15:08:44
【问题描述】:
我正在尝试使用如下所示的过滤器获取列表,但它无法按我想要的方式工作。
在whereIn('lists.status', $status) 中,它应该只返回状态为 1,3 或 4 的列表。但它目前返回所有没有特定状态的列表。
$status = [1, 3, 4];
$lists = List::query();
$lists->join("users", "users.user_id", "=", "lists.user_id")
->join('details', 'details.id', '=', 'lists.id')
->whereIn('lists.status', $status) <--- this is not working
->where('users.name', "LIKE", "john")
->orWhere('details.name', "LIKE", "john");
【问题讨论】:
标签: sql laravel laravel-5 eloquent