V
V
Vanya Huk2017-02-22 23:34:19
ORM
Vanya Huk, 2017-02-22 23:34:19

How to pass parameters to DB:raw()?

How to pass parameters to this request?

Filter::select('*', \DB::raw("( SELECT COUNT(*) from filter_products 
    	 
    	 where product_id in ( select category_products.product_id from
    	  
    	  category_products where category_products.category_id = '?'
        
        group by category_products.product_id
        
        )  and filters.id = filter_products.filter_id
        ) as total ",[ $this -> category_id ]) )

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav Plisko, 2017-02-23
@AmdY

Everything seems to be correct, the second parameter. What version of the framework?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question