|
|
|
|
@ -350,13 +350,13 @@ class OrdersController extends CommonController
|
|
|
|
|
$query->where("status", Orders::STATUS_ONGOING);
|
|
|
|
|
//todo:计算自动结单对当前所选日期的订单数的影响
|
|
|
|
|
}])->find($request->paramedic_id);
|
|
|
|
|
dd($paramedic);
|
|
|
|
|
$product_paramedic_level = (new ProductParamedicLevel())->find($paramedic->paramedic_level_id);
|
|
|
|
|
$product_item = (new ProductItems())->where("patient_quantity", "<=", $paramedic->orders_count + 1)->orderBy("patient_quantity", "desc")->first();
|
|
|
|
|
} else {
|
|
|
|
|
$product_paramedic_level = (new ProductParamedicLevel())->where("product_id", $request->product_id)->where("price", 0)->first();
|
|
|
|
|
$product_item = (new ProductItems())->where("product_id", $request->product_id)->where("patient_quantity",1)->first();
|
|
|
|
|
}
|
|
|
|
|
dd($product_item);
|
|
|
|
|
|
|
|
|
|
$price = $product_item->price + $product_paramedic_level->price;
|
|
|
|
|
$factors = (new Orders())->requestFactorsToOrderFactors();
|
|
|
|
|
|