weizong song 2 years ago
parent c208bd422b
commit c35076d599

@ -399,8 +399,11 @@ class Orders extends SoftDeletesModel
$product = (new Project())->find($bed->project_id)->products->first();
foreach ($paramedics as $paramedic) {
$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??0 + $product_item->price??0;
dump($paramedic->levelInProject->price,$product_item->price);
$_product_item_price = $product_item->price ? $product_item->price : 0;
$_paramedic_price = $paramedic->levelInProject->price ? $paramedic->levelInProject->price : 0;
$price = $_product_item_price + $_paramedic_price;
dump($price);
foreach ($factors as $factor) {
$price += $factor["price"]??0;
}

Loading…
Cancel
Save