|
@@ -11,9 +11,9 @@ class GoodsSalesController{
|
|
|
{
|
|
|
$rows = OrderSheet::leftJoin('goods','goods.goods_id','=','order_sheet.join_sheet_goods_id')
|
|
|
->leftJoin('goods_sku','goods_sku.join_sku_goods_id','=','order_sheet.join_sheet_goods_id')
|
|
|
- ->selectRaw('SUM(app_order_sheet.order_sheet_num) as num,SUM(app_order_sheet_pay) as amount,CONCAT(app_goods.goods_id,"-",app_goods_sku.goods_sku_id) as goods_flag')
|
|
|
- ->orderBy('order_sheet_addtimes','DESC')
|
|
|
- ->groupBy('goods_flag')
|
|
|
+ ->selectRaw('app_goods.goods_id,SUM(app_order_sheet.order_sheet_num) as num,SUM(app_order_sheet.order_sheet_pay) as amount,app_goods.goods_id,app_goods_sku.goods_sku_id')
|
|
|
+ ->groupBy(['goods.goods_id','goods_sku.goods_sku_id'])
|
|
|
+ ->orderBy('num','DESC')
|
|
|
->get();
|
|
|
|
|
|
dump($rows);
|