|
@@ -81,7 +81,7 @@ class GoodsData extends Backend
|
|
|
->where($where)
|
|
|
->where('order_id','in',$orderIds)
|
|
|
->where('is_return_goods',0)
|
|
|
- ->where('goods_id',$v['goods_id'])->sum('amount_cost');//某商品总成本
|
|
|
+ ->where('goods_id',$v['goods_id'])->sum('amount_cost_total');//某商品总成本
|
|
|
$amountCostTotal = $amountCostTotal*$saleTotalNum;
|
|
|
$gross = bcsub($saleTotal, $amountCostTotal);//某商品毛利
|
|
|
$grossRate = 0;
|
|
@@ -137,7 +137,7 @@ class GoodsData extends Backend
|
|
|
//毛利、毛利率
|
|
|
$install = Db('Orders')->where($where)->where('status', 'in', '5,10,20')->sum('amount_install');//总安装费
|
|
|
$orderIds = Db('Orders')->where($where)->where('status', 'in', '5,10,20')->column('id');
|
|
|
- $cost = Db('OrderInfo')->where('order_id', 'in', $orderIds)->sum('amount_cost');//总成本
|
|
|
+ $cost = Db('OrderInfo')->where('order_id', 'in', $orderIds)->sum('amount_cost_total');//总成本
|
|
|
$gross_profit = bcsub($sale, $install);
|
|
|
$gross_profit = bcsub($gross_profit, $cost);
|
|
|
$gross_profit_margin = 0;
|