PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | api/Resource/OrderItemResource.php +2 -0 1.5.3 → 1.6.5 View file →
@@ -336,8 +336,10 @@
336 336 *
337 337 */
338 338 public static function topProductsSold($params = [])
339 339 {
340 + $params = is_array($params) ? $params : [];
341 +
340 342 return OrderItem::search(Arr::only($params, ['created_at']))
341 343 ->select('post_id')
342 344 ->selectRaw('SUM(quantity) as total_sold')
343 345 ->groupBy('post_id')