2015-04-20 20 views
2

假设我们有两个表:没有模型雄辩关系

products    product_langs 
==============   ============== 
    id      id_product 
    name     lang 
          description 

现在,我想这两个表连接在一起,如:

return $product->hasOne('App/ProductLang') 
    ->where('id_product', '=', 'id') 
    ->where('lang', '=', $lang); 

是否有开箱可能性在没有型号App/ProductLang的情况下做到这一点?

+0

使用查询生成 – Yada

+1

我删除了您的标题标签,增加语法高亮显示你的PHP代码,改进的格式和语法。 –

回答