|
|
|
|
@ -85,6 +85,9 @@ class OrderController extends Controller
|
|
|
|
|
$coupon_id = request('coupon_id');//优惠券
|
|
|
|
|
$jifen = request('jifen', 0); //使用的积分数量
|
|
|
|
|
$yucunkuan = request('yucunkuan', 0);//使用的预存款数量
|
|
|
|
|
$erxian_info= request('erxian_info');//使用的预存款数量
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$wj_flag = request('wj'); //问卷标记
|
|
|
|
|
if (isset($wj_flag) and $wj_flag == 1) {
|
|
|
|
|
@ -337,6 +340,29 @@ class OrderController extends Controller
|
|
|
|
|
$true_price = $true_price - ($jifen + $yucunkuan);
|
|
|
|
|
if ($true_price < -1) return \Yz::echoError1("预抵扣金额超过订单金额,操作失败");
|
|
|
|
|
if ($true_price < 0) $true_price = 0;
|
|
|
|
|
//如果有二线号源,根据体检时间查询二线可用号源,区分上下午
|
|
|
|
|
$plan_nmr_info=[];
|
|
|
|
|
if (isset($erxian_info) and !empty($erxian_info)) {
|
|
|
|
|
foreach ($erxian_info as $erxian_item) {
|
|
|
|
|
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$plan->date],'action'=>"1"],uniqid());
|
|
|
|
|
if($plan->time<="12:00") $end_time="12:00";
|
|
|
|
|
if($plan->time>"12:00") $end_time="23:59";
|
|
|
|
|
if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选则日期");
|
|
|
|
|
foreach ($nmrPlans[$plan->date] as $nmp_p){
|
|
|
|
|
|
|
|
|
|
if($nmp_p['Time']>=substr($plan->time,0,5) and $nmp_p['Time']<=$end_time and $nmp_p['keyong']==="0"){
|
|
|
|
|
$plan_nmr_info[]=[
|
|
|
|
|
"item_id"=>$erxian_item['item_id'],
|
|
|
|
|
"name"=>$erxian_item['name'],
|
|
|
|
|
"price"=>$erxian_item['price'],
|
|
|
|
|
"time"=>$plan->date." ".$nmp_p['Time'],
|
|
|
|
|
];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//校验二线号源
|
|
|
|
|
if (isset($plan_nmr_info) and !empty($plan_nmr_info)) {
|
|
|
|
|
@ -720,22 +746,7 @@ class OrderController extends Controller
|
|
|
|
|
if($order_info->hospital_id == 4){
|
|
|
|
|
$yyid=2;
|
|
|
|
|
}
|
|
|
|
|
//如果有二线信息校验二线号源是否可用
|
|
|
|
|
// $erxian_info=json_decode($order_info->erxian_appointment_info, true);
|
|
|
|
|
// if (isset($erxian_info) and !empty($erxian_info)) {
|
|
|
|
|
// foreach ($erxian_info as $key => $plan_nmr) {
|
|
|
|
|
// $p_nmr_data = [
|
|
|
|
|
// 'item_id' => $plan_nmr['item_id'],
|
|
|
|
|
// 'name' => $plan_nmr['name'],
|
|
|
|
|
// 'date' => $plan_nmr['date'],
|
|
|
|
|
// 'time' => $plan_nmr['time'],
|
|
|
|
|
// ];
|
|
|
|
|
// //调用接口校验号源是否可用
|
|
|
|
|
// $erxian_status = $AspNet::ErXian(['YYRQ' => $p_nmr_data['date'], 'YYSJ' => $p_nmr_data['time'], 'yyid' => $yyid, 'action' => 4], uniqid());
|
|
|
|
|
// if ($erxian_status !== true) return ['status' => false, 'msg' => $p_nmr_data['name'] . '号源不可用'];
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$buy_info = json_decode($order_info->buy_info, true);
|
|
|
|
|
$combo_id = $buy_info['combo']['id'];
|
|
|
|
|
|