C
C
cadaver2016-10-26 13:18:44
Laravel
cadaver, 2016-10-26 13:18:44

How to split cells in laravel?

Here is part of the request

$places = Place::where('price', '<=', $price_filter)->where('people', '>=', $people_filter)->whereHas('metros', function ($query) use ($metros) {
        $query->whereIn('metro_id', $metros);
      })->whereHas('comforts', function ($query) use ($comforts) {
        $query->whereIn('comfort_id', $comforts);
      })->orderBy('price', 'desc')->skip($offset)->take($take)->get();

I need to
where('price', '<=', $price_filter)
get the value in this part (compare with $price_filter) divided by the value in the people cell

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2016-10-26
@aleshka-ne-programmist

get the value (compare with $price_filter) divided by the value in the people cell
not sure what to share? variable or price in the database divided by people?
where(DB::raw('(price/people)'), '<=', $price_filter)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question