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);
答案 0 :(得分:2)
您的代码中存在语法错误,它缺少>
,应该阅读
->paginate(10);
而不是
-paginate(10);