You can get rid of your $ids variable. No need to use implode with query builders. As for your array_map, I don't understand what you're trying to accomplish with it, so I'll let you update this piece of code to suit your needs.
I just migrated from old php project and it has very lengthy sql statement. And I don't have time to construct all the model and restructure to the query builder like yours above. I just want to know how to bind it using DB::select