weizong song 5 years ago
parent c266e89728
commit 0397ab931f

@ -350,15 +350,12 @@ class OrdersController extends CommonController
$query->where("status", Orders::STATUS_ONGOING);
//todo:计算自动结单对当前所选日期的订单数的影响
}])->find($request->paramedic_id);
DB::enableQueryLog();
$product_paramedic_level = (new ProductParamedicLevel())->find($paramedic->paramedic_level_id);
dd($product_paramedic_level,DB::getQueryLog());
$product_paramedic_level = (new ProductParamedicLevel())->where("paramedic_level_id",$paramedic->paramedic_level_id)->first();
$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,$product_paramedic_level);
$price = $product_item->price + $product_paramedic_level->price;
$factors = (new Orders())->requestFactorsToOrderFactors();

Loading…
Cancel
Save