feat(OrderLogic): 修改订单逻辑以支持新活动与库存计算, 重构利润计算方式
This commit is contained in:
parent
49d7b67ea9
commit
617be65057
@ -74,8 +74,7 @@ class OrderLogic extends BaseLogic
|
|||||||
|
|
||||||
// $productBase = StoreProduct::where('id', $find['product_id'])->withTrashed()->field('price,ot_price,cost')->find();
|
// $productBase = StoreProduct::where('id', $find['product_id'])->withTrashed()->field('price,ot_price,cost')->find();
|
||||||
if (isset($check) && $check['status'] == 1) {
|
if (isset($check) && $check['status'] == 1) {
|
||||||
self::$activity_price = bcadd(self::$activity_price, bcsub($find['price'],$find['cost'],2), 2);
|
self::$activity_price = bcadd(self::$activity_price, bcmul($find['price'],0.9,2), 2);
|
||||||
$find['price'] = $find['cost'];
|
|
||||||
}
|
}
|
||||||
//利润
|
//利润
|
||||||
$onePrice = bcsub($find['price'], $find['cost'], 2);
|
$onePrice = bcsub($find['price'], $find['cost'], 2);
|
||||||
@ -84,7 +83,7 @@ class OrderLogic extends BaseLogic
|
|||||||
$cart_select[$k]['total'] = bcmul($v['cart_num'], $find['price'], 2);//钱
|
$cart_select[$k]['total'] = bcmul($v['cart_num'], $find['price'], 2);//钱
|
||||||
$cart_select[$k]['price'] = $find['price'];
|
$cart_select[$k]['price'] = $find['price'];
|
||||||
$cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2);//钱
|
$cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2);//钱
|
||||||
$cart_select[$k]['product_id'] = $v['goods'];
|
$cart_select[$k]['product_id'] = $v['product_id'];
|
||||||
$cart_select[$k]['old_cart_id'] = $v['id'];
|
$cart_select[$k]['old_cart_id'] = $v['id'];
|
||||||
$cart_select[$k]['cart_num'] = $v['cart_num'];
|
$cart_select[$k]['cart_num'] = $v['cart_num'];
|
||||||
$cart_select[$k]['verify_code'] = $params['verify_code'] ?? '';
|
$cart_select[$k]['verify_code'] = $params['verify_code'] ?? '';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user