修改预订单导出
This commit is contained in:
parent
f27d25311a
commit
a8acf3ae67
@ -431,6 +431,7 @@ class BeforehandOrderLogic extends BaseLogic
|
|||||||
// } else {
|
// } else {
|
||||||
// $price = StoreProductGroupPrice::where('product_id', $arr['product_id'])->where('group_id', $user_ship)->value('price') ?? 0;
|
// $price = StoreProductGroupPrice::where('product_id', $arr['product_id'])->where('group_id', $user_ship)->value('price') ?? 0;
|
||||||
// }
|
// }
|
||||||
|
$cost = StoreProduct::where('id', $arr['product_id'])->withTrashed()->value('cost') ?? 0;
|
||||||
$data = [
|
$data = [
|
||||||
'warehouse_id' => $warehouse_id,
|
'warehouse_id' => $warehouse_id,
|
||||||
'product_id' => $arr['product_id'],
|
'product_id' => $arr['product_id'],
|
||||||
@ -443,6 +444,7 @@ class BeforehandOrderLogic extends BaseLogic
|
|||||||
'admin_id' => $admin_id,
|
'admin_id' => $admin_id,
|
||||||
'total_price' => $arr['total_price'],
|
'total_price' => $arr['total_price'],
|
||||||
'price' => $arr['price'],
|
'price' => $arr['price'],
|
||||||
|
'cost' => $cost,
|
||||||
'vip_price' => StoreProduct::where('id',$arr['product_id'])->withTrashed()->value('vip_price') ?? 0,
|
'vip_price' => StoreProduct::where('id',$arr['product_id'])->withTrashed()->value('vip_price') ?? 0,
|
||||||
'purchase' => $arr['purchase'],
|
'purchase' => $arr['purchase'],
|
||||||
'oid' => $res['id'],
|
'oid' => $res['id'],
|
||||||
@ -958,6 +960,10 @@ class BeforehandOrderLogic extends BaseLogic
|
|||||||
$v['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name');
|
$v['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name');
|
||||||
$v['store_name'] = $find['store_name'];
|
$v['store_name'] = $find['store_name'];
|
||||||
$v['mark'] = $find['after_sales'];
|
$v['mark'] = $find['after_sales'];
|
||||||
|
if (isset($params['type']) && $params['type'] == 2) {
|
||||||
|
$price = $v['cost'];
|
||||||
|
$v['pay_price'] = bcmul($price, $v['nums'], 2);
|
||||||
|
} else {
|
||||||
if ($v['vip_price'] > 0) {
|
if ($v['vip_price'] > 0) {
|
||||||
$v['pay_price'] = bcmul($v['vip_price'], $v['nums'], 2);
|
$v['pay_price'] = bcmul($v['vip_price'], $v['nums'], 2);
|
||||||
$price = $v['vip_price'];
|
$price = $v['vip_price'];
|
||||||
@ -971,6 +977,7 @@ class BeforehandOrderLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
WarehouseProduct::where('id', $v['id'])->update(['vip_price' => $price]);
|
WarehouseProduct::where('id', $v['id'])->update(['vip_price' => $price]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$v['purchase'] = $price;
|
$v['purchase'] = $price;
|
||||||
$v['profit'] = bcsub($v['total_price'], $v['pay_price'], 2);
|
$v['profit'] = bcsub($v['total_price'], $v['pay_price'], 2);
|
||||||
|
@ -176,6 +176,7 @@ class WarehouseProductLogic extends BaseLogic
|
|||||||
'price' => $params['price'] ?? 0,
|
'price' => $params['price'] ?? 0,
|
||||||
'purchase' => $params['purchase'] ?? 0,
|
'purchase' => $params['purchase'] ?? 0,
|
||||||
'vip_price' => $params['vip_price'] ?? 0,
|
'vip_price' => $params['vip_price'] ?? 0,
|
||||||
|
'cost' => $params['cost'] ?? 0,
|
||||||
'total_price' => $params['total_price'] ?? 0,
|
'total_price' => $params['total_price'] ?? 0,
|
||||||
'admin_id' => $params['admin_id'],
|
'admin_id' => $params['admin_id'],
|
||||||
'code' => $params['code'] ?? '',
|
'code' => $params['code'] ?? '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user