Merge remote-tracking branch 'origin/master'

master
liyinglin 2 years ago
commit f30d7e1394

@ -129,6 +129,7 @@ class OrdersController extends CommonController
public function getAvailableParamedics(Request $request)
{
//Log::channel("daily_customer_order_request")->info($request->all());
$paramedics = (new Orders())->getAvailableParamedics();
return response()->json($paramedics);
}

@ -399,9 +399,13 @@ 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;
$_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;
foreach ($factors as $factor) {
$price += $factor["price"]??0;
$_factor_price = $factor["price"] ? $factor["price"] : 0;
$price += $_factor_price;
}
$paramedic->price = $price;
}

@ -53,6 +53,12 @@ return [
'level' => 'debug',
],
'daily_customer_order_request' => [
'driver' => 'daily',
'path' => storage_path('logs/daily_customer_order_request.log'),
'level' => 'debug',
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),

Loading…
Cancel
Save