Laravel与FIND_IN_SET联接

时间:2016-09-18 16:43:10

标签: laravel-5.2

我是laravel 5.2的新手,我想了解更多有关laravel查询构建器的信息,     实际上我想知道如何在laravel中编写这个SQL查询

SQL -> select d.*, c.*, ct.*, a.*, b.*, m.* FROM tbl_deal d
        INNER JOIN tbl_category c ON d.deal_category_id = c.category_id
        INNER JOIN tbl_brand b ON d.deal_brand_id = b.brand_id
        INNER JOIN tbl_member m ON m.member_id = d.deal_member_id       
        INNER JOIN tbl_city ct ON FIND_IN_SET(ct.city_id,d.deal_city)
        LEFT JOIN tbl_outlet o ON FIND_IN_SET(o.outlet_id,d.deal_outlets)
        LEFT JOIN tbl_area a ON a.area_id = o.outlet_area_id 

1 个答案:

答案 0 :(得分:2)

请尝试这样的查询:

my @a = <foo bar barkeep>;
say "barkeeper" ~~ / @a /;     # 「barkeep」
say "barkeeper" ~~ / || @a /;  # 「bar」