-8

This will not convert to Laravel 4 DB Fluent.

$result = $this->database->query("
SELECT     node.title,
           node.title_slug,
           node.item_type,
           node.item_class,
           node.content,
           node.id                   AS id,
           node.lft                  AS lft,
           node.rgt                  AS rgt,
           (COUNT(parent.title) - 1) AS depth
FROM       menuitems                 AS node
           CROSS JOIN menuitems      AS parent
WHERE      node.menu_id   = '$menu_id'
AND        parent.menu_id = '$menu_id'
AND        node.lft BETWEEN parent.lft AND parent.rgt
GROUP BY   node.id
ORDER BY   node.lft
");

Need to convert this to Laravel 4 DB Fluent.

4

2 回答 2

0
DB::table('table_name')->join('another_table','on_condition_','on_operator','on_condition','cross’)->select(['item1','imtem2'.....]);
于 2015-04-04T00:05:58.703 回答
0

我认为问题在于 fluent 目前还没有交叉连接,只有连接和左连接,您可能想询问是否为下一个测试版添加它,或者看看是否有另一种方法来编写它?

于 2013-05-22T14:43:15.640 回答