there is my code:
protected function room_count($room_count)
{
$query = $this->builder
->whereJsonContains('rent_requests.rooms_count', $room_count);
return $query;
}
There is my filter function. $room_count is array, and for example can be [2,4]. rent_requests.rooms_count is JSON array in MySQL, and it can be for example [2,3]. I need to filter this, to get this advert showed, but whereJSONContains expects that there will be 2 and 4, not 2 or 4. Is there any tricks to make this function work correctly ? Something like json contains whereIn ?) Sorry for my english, im really stuck on this, please help me :)



所有评论(0)