|
|
|
|
@ -79,7 +79,7 @@ class OrderController extends Controller
|
|
|
|
|
|
|
|
|
|
$duo_xuan_yi = request('duo_xuan_yi'); //多选1
|
|
|
|
|
$plan_id = request('plan_id');//号源id
|
|
|
|
|
$plan_nmr_id = request('plan_nmr_id');//核磁号源id
|
|
|
|
|
$plan_nmr_info = request('plan_nmr_info');//核磁号源信息
|
|
|
|
|
$doctor = request('doctor');//预约的医生名字
|
|
|
|
|
$coupon_id = request('coupon_id');//优惠券
|
|
|
|
|
$jifen = request('jifen', 0); //使用的积分数量
|
|
|
|
|
@ -91,6 +91,12 @@ class OrderController extends Controller
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isset($hospital_id)) return \Yz::echoError1('医院id不能为空');
|
|
|
|
|
if ($hospital_id == 1) {
|
|
|
|
|
$yyid = 6;
|
|
|
|
|
}
|
|
|
|
|
if ($hospital_id == 4) {
|
|
|
|
|
$yyid = 2;
|
|
|
|
|
}
|
|
|
|
|
if (!isset($openid)) return \Yz::echoError1('openid不能为空');
|
|
|
|
|
if (!isset($person_id)) return \Yz::echoError1('person_id不能为空');
|
|
|
|
|
if (!isset($type)) return \Yz::echoError1('type体检类型不能为空');
|
|
|
|
|
@ -316,7 +322,7 @@ class OrderController extends Controller
|
|
|
|
|
return \Yz::echoError1("预约日期不在单位有效时间范围内,请重新选择");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$plan_nmr_appointment_info=[];
|
|
|
|
|
//校验积分和预存款
|
|
|
|
|
$env = config('app.globals.Env');
|
|
|
|
|
$AspNet = new AspNetZhuanController();
|
|
|
|
|
@ -339,10 +345,7 @@ class OrderController extends Controller
|
|
|
|
|
if (isset($coupon_id) and !empty($coupon_id)) {
|
|
|
|
|
if ($true_price == 0) return \Yz::echoError1("无需使用代金券");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($env=='pro') { //如果是正式环境
|
|
|
|
|
$AspNet = new AspNetZhuanController();
|
|
|
|
|
|
|
|
|
|
$data = [
|
|
|
|
|
'ghzid' => $person->ghzid,
|
|
|
|
|
'action' => 1,
|
|
|
|
|
@ -376,9 +379,27 @@ class OrderController extends Controller
|
|
|
|
|
//抵扣代金券金额,折扣暂未实现
|
|
|
|
|
$true_price = ($true_price - $quanInfo['JE']) > 0 ? $true_price - $quanInfo['JE'] : 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (isset($plan_nmr_info) and !empty($plan_nmr_info)) {
|
|
|
|
|
$plan_nmr_temp = [];
|
|
|
|
|
foreach ($plan_nmr_info as $key => $plan_nmr) {
|
|
|
|
|
if ($plan_nmr['item_id'] <> -1) {
|
|
|
|
|
$p_nmr_data = [
|
|
|
|
|
'item_id' => $plan_nmr['item_id'],
|
|
|
|
|
'name' => $plan_nmr['name'],
|
|
|
|
|
'date' => substr($plan_nmr['time'], 0, 10),
|
|
|
|
|
'time' => substr($plan_nmr['time'], 10, 5),
|
|
|
|
|
];
|
|
|
|
|
//调用接口校验号源是否可用
|
|
|
|
|
$erxian_status = $AspNet::ErXian(['YYRQ' => $p_nmr_data['date'], 'YYSJ' => $p_nmr_data['time'], 'yyid' => $yyid, 'action' => 4], uniqid());
|
|
|
|
|
if ($erxian_status !== true) return \Yz::echoError1($p_nmr_data['name'] . '号源不可用,请重新选择');
|
|
|
|
|
$plan_nmr_temp[] = $p_nmr_data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$plan_nmr_appointment_info=$plan_nmr_temp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$now_datetime = date('Y-m-d H:i:s');
|
|
|
|
|
@ -402,6 +423,7 @@ class OrderController extends Controller
|
|
|
|
|
'status' => 1,
|
|
|
|
|
'appointment_date' => $plan->date,
|
|
|
|
|
'appointment_time' => $plan->time,
|
|
|
|
|
'erxian_appointment_info' => json_encode($plan_nmr_appointment_info, JSON_UNESCAPED_UNICODE),
|
|
|
|
|
'plan_id' => $plan->id,
|
|
|
|
|
'plan_number' => $plan->plan_number,
|
|
|
|
|
'combo_id' => $combo_id,
|
|
|
|
|
@ -430,13 +452,7 @@ class OrderController extends Controller
|
|
|
|
|
$jifen_dikou_status = true;
|
|
|
|
|
$yucunkuan_dikou_status = true;
|
|
|
|
|
$youhuiquan_dikou_status = true;
|
|
|
|
|
$r_yyid = $hospital_id;
|
|
|
|
|
if($r_yyid==1){
|
|
|
|
|
$yyid=6;
|
|
|
|
|
}
|
|
|
|
|
if($r_yyid==4){
|
|
|
|
|
$yyid=2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($env == 'pro') { //如果是正式环境
|
|
|
|
|
if ($jifen > 0) {
|
|
|
|
|
$jifen_dikou_status = false;
|
|
|
|
|
|