修改预订单高级会员导出 #5
@ -968,27 +968,17 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
$v['store_name'] = $find['store_name'];
|
||||
$v['mark'] = $find['after_sales'];
|
||||
if (isset($params['type']) && $params['type'] == 2) {
|
||||
$price = $v['purchase'];
|
||||
$v['price'] = $v['cost'];
|
||||
$v['total_price'] = bcmul($v['price'], $v['nums'], 2);
|
||||
$v['pay_price'] = bcmul($price, $v['nums'], 2);
|
||||
$v['price'] = $v['cost']; //出库单价
|
||||
$v['total_price'] = bcmul($v['price'], $v['nums'], 2); //出库总价
|
||||
} else {
|
||||
if ($v['vip_price'] > 0) {
|
||||
$v['pay_price'] = bcmul($v['vip_price'], $v['nums'], 2);
|
||||
$price = $v['vip_price'];
|
||||
$v['total_price'] = bcmul($v['vip_price'], $v['nums'], 2);
|
||||
} else {
|
||||
$price = StoreProductGroupPrice::where('product_id', $v['product_id'])->where('group_id', $user_ship)->value('price');
|
||||
if ($price > 0) {
|
||||
$v['pay_price'] = bcmul($price, $v['nums'], 2);
|
||||
} else {
|
||||
$price = $find['cost'];
|
||||
$v['pay_price'] = bcmul($price, $v['nums'], 2);
|
||||
}
|
||||
WarehouseProduct::where('id', $v['id'])->update(['vip_price' => $price]);
|
||||
$v['total_price'] = bcmul($v['price'], $v['nums'], 2);
|
||||
}
|
||||
}
|
||||
|
||||
$v['purchase'] = $price;
|
||||
$v['pay_price'] = bcmul($v['purchase'], $v['nums'], 2); //供货总价
|
||||
$v['profit'] = bcsub($v['total_price'], $v['pay_price'], 2);
|
||||
$total_profit = bcadd($total_profit, $v['profit'], 2);
|
||||
$pay_price = bcadd($pay_price, $v['pay_price'], 2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user