调用未定义的函数paginate()

时间:2017-11-09 11:20:39

标签: php laravel

 return $data = DB::select("SELECT orders.*,SUM(products.`product_price`*order_product.`qty`) AS 'total' ,users.`name`,orders.created_at as 'date'
                    FROM orders INNER JOIN order_product ON
                    orders.`id` = order_product.`order_id` 
                    INNER JOIN products ON
                    products.`id` = order_product.`product_id` 
                    INNER JOIN users ON 
                    users.`id` = orders.`user_id`
                    GROUP BY orders.`id`
                    ")-paginate(10);

1 个答案:

答案 0 :(得分:2)

您的代码中存在语法错误,它缺少>,应该阅读

->paginate(10);

而不是

-paginate(10);