如何实现SQL Laravel动态参数?

时间:2017-11-08 01:44:47

标签: php sql laravel

我正在使用此查询:

我从URL

获取带有ID的ARRAY参数
$id[] = explode(',', $ingredient_id) ;

  $gets = DB::select('Select distinct record_translate.title, record.image_preview
        from record_translate rtrans, record_has_ingre rhi, country c, ingre i , filter f, record r
        where rhi.ingre_id IN (:rec, 5);
        ');

但我需要将INSIDE“IN”放在一个值为ids的数组中。

在这种情况下如何实现?

0 个答案:

没有答案