|
|
|
|
@ -396,8 +396,9 @@ class Orders extends SoftDeletesModel
|
|
|
|
|
|
|
|
|
|
//价格运算
|
|
|
|
|
$factors = (new Orders())->requestFactorsToOrderFactors();
|
|
|
|
|
$product = (new Project())->find($bed->project_id)->products->first();
|
|
|
|
|
foreach ($paramedics as $paramedic) {
|
|
|
|
|
$product_item = ProductItems::where("patient_quantity", "<=", $paramedic->ongoing_orders_count + 1)->orderBy("patient_quantity", "desc")->first();
|
|
|
|
|
$product_item = ProductItems::where("product_id", $product->id)->where("patient_quantity", "<=", $paramedic->ongoing_orders_count + 1)->orderBy("patient_quantity", "desc")->first();
|
|
|
|
|
$price = $paramedic->levelInProject->price + $product_item->price;
|
|
|
|
|
foreach ($factors as $factor) {
|
|
|
|
|
$price += $factor["price"];
|
|
|
|
|
|