refactor(OrderLogic): 修改订单逻辑以使用商品成本计算利润

This commit is contained in:
mkm 2024-06-09 15:02:20 +08:00
parent 876d2d8dd9
commit 5527ec60dd

View File

@ -74,7 +74,7 @@ class OrderLogic extends BaseLogic
}
unset($cart_select[$k]['id']);
//利润
$onePrice = bcsub($find['price'], $find['ot_price'], 2);
$onePrice = bcsub($find['price'], $find['cost'], 2);
$cart_select[$k]['profit'] = bcmul($v['cart_num'], $onePrice, 2);//利润
$cart_select[$k]['cost'] = bcmul($v['cart_num'], $find['cost'], 2) ?? 0;
$cart_select[$k]['total'] = bcmul($v['cart_num'], $find['price'], 2);//钱