|
|
|
@ -319,6 +319,7 @@ class OrderNewController extends Controller
|
|
|
|
"item_id" => $erxian_item['item_id'],
|
|
|
|
"item_id" => $erxian_item['item_id'],
|
|
|
|
"name" => $erxian_item['name'],
|
|
|
|
"name" => $erxian_item['name'],
|
|
|
|
"price" => $erxian_item['price'],
|
|
|
|
"price" => $erxian_item['price'],
|
|
|
|
|
|
|
|
"leixing"=>$erxian_item['leixing'],
|
|
|
|
];
|
|
|
|
];
|
|
|
|
$plan_nmr_info[] = $temp_date;
|
|
|
|
$plan_nmr_info[] = $temp_date;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -486,8 +487,10 @@ class OrderNewController extends Controller
|
|
|
|
$erxian_info=json_decode($order->erxian_appointment_info,true);
|
|
|
|
$erxian_info=json_decode($order->erxian_appointment_info,true);
|
|
|
|
$AspNet = new AspNetZhuanController();
|
|
|
|
$AspNet = new AspNetZhuanController();
|
|
|
|
if (isset($erxian_info) and !empty($erxian_info)) {
|
|
|
|
if (isset($erxian_info) and !empty($erxian_info)) {
|
|
|
|
foreach ($erxian_info as $erxian_item) {
|
|
|
|
foreach ($erxian_info as $key=> $erxian_item) {
|
|
|
|
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$plan->date],'action'=>"1"],uniqid());
|
|
|
|
|
|
|
|
|
|
|
|
if($erxian_item['leixing']==1){
|
|
|
|
|
|
|
|
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$plan->date],'action'=>"1",'leixing'=>$erxian_item['leixing']],uniqid());
|
|
|
|
$end_time="23:59";
|
|
|
|
$end_time="23:59";
|
|
|
|
if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选择日期");
|
|
|
|
if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选择日期");
|
|
|
|
$temp_date=[];
|
|
|
|
$temp_date=[];
|
|
|
|
@ -501,6 +504,7 @@ class OrderNewController extends Controller
|
|
|
|
"name"=>$erxian_item['name'],
|
|
|
|
"name"=>$erxian_item['name'],
|
|
|
|
"price"=>$erxian_item['price'],
|
|
|
|
"price"=>$erxian_item['price'],
|
|
|
|
"time"=>$plan->date." ".$nmp_p['Time'],
|
|
|
|
"time"=>$plan->date." ".$nmp_p['Time'],
|
|
|
|
|
|
|
|
"leixing"=>$erxian_item['leixing']
|
|
|
|
];
|
|
|
|
];
|
|
|
|
$plan_nmr_info[]=$temp_date;
|
|
|
|
$plan_nmr_info[]=$temp_date;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@ -508,8 +512,43 @@ class OrderNewController extends Controller
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(empty($temp_date)) return \Yz::echoError1("二线号源不可用,请重新选择日期");
|
|
|
|
if(empty($temp_date)) return \Yz::echoError1("二线号源不可用,请重新选择日期");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if($erxian_item['leixing']==2 or $erxian_item['leixing']==3){
|
|
|
|
|
|
|
|
$find=false;
|
|
|
|
|
|
|
|
$startDate = $plan->date;
|
|
|
|
|
|
|
|
$date = new DateTime($startDate);
|
|
|
|
|
|
|
|
$date->modify('+1 day'); // 先跳过当天
|
|
|
|
|
|
|
|
for ($i = 0; $i < 15; $i++) {
|
|
|
|
|
|
|
|
$newdate=$date->format('Y-m-d');
|
|
|
|
|
|
|
|
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$newdate],'action'=>"1",'leixing'=>$erxian_item['leixing']],uniqid());
|
|
|
|
|
|
|
|
if(!isset($nmrPlans[$newdate]) or empty($nmrPlans[$newdate])){
|
|
|
|
|
|
|
|
$date->modify('+1 day');
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($nmrPlans[$newdate] as $nmp_p){
|
|
|
|
|
|
|
|
if($nmp_p['keyong']==="0"){
|
|
|
|
|
|
|
|
$temp_date=[
|
|
|
|
|
|
|
|
"item_id"=>$erxian_item['item_id'],
|
|
|
|
|
|
|
|
"name"=>$erxian_item['name'],
|
|
|
|
|
|
|
|
"price"=>$erxian_item['price'],
|
|
|
|
|
|
|
|
"time"=>$newdate." ".$nmp_p['Time'],
|
|
|
|
|
|
|
|
"leixing"=>$erxian_item['leixing']
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
$plan_nmr_info[]=$temp_date;
|
|
|
|
|
|
|
|
$find=true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if($find) break;
|
|
|
|
|
|
|
|
// 增加一天
|
|
|
|
|
|
|
|
$date->modify('+1 day');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//校验二线号源
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//校验二线号源
|
|
|
|
if (isset($plan_nmr_info) and !empty($plan_nmr_info)) {
|
|
|
|
if (isset($plan_nmr_info) and !empty($plan_nmr_info)) {
|
|
|
|
$plan_nmr_temp = [];
|
|
|
|
$plan_nmr_temp = [];
|
|
|
|
foreach ($plan_nmr_info as $key => $plan_nmr) {
|
|
|
|
foreach ($plan_nmr_info as $key => $plan_nmr) {
|
|
|
|
@ -521,9 +560,10 @@ class OrderNewController extends Controller
|
|
|
|
'date' => $dt[0],
|
|
|
|
'date' => $dt[0],
|
|
|
|
'time' => $dt[1],
|
|
|
|
'time' => $dt[1],
|
|
|
|
'price' => $plan_nmr['price'],
|
|
|
|
'price' => $plan_nmr['price'],
|
|
|
|
|
|
|
|
'leixing' => $plan_nmr['leixing']
|
|
|
|
];
|
|
|
|
];
|
|
|
|
//调用接口校验号源是否可用
|
|
|
|
//调用接口校验号源是否可用
|
|
|
|
$erxian_status = $AspNet::ErXian(['YYRQ' => $p_nmr_data['date'], 'YYSJ' => $p_nmr_data['time'], 'yyid' => $yyid, 'action' => 4], uniqid());
|
|
|
|
$erxian_status = $AspNet::ErXian(['YYRQ' => $p_nmr_data['date'], 'YYSJ' => $p_nmr_data['time'], 'yyid' => $yyid, 'action' => 4,'leixing'=>$p_nmr_data['leixing']], uniqid());
|
|
|
|
if ($erxian_status !== true) return \Yz::echoError1($p_nmr_data['name'] . '号源不可用,请重新选择');
|
|
|
|
if ($erxian_status !== true) return \Yz::echoError1($p_nmr_data['name'] . '号源不可用,请重新选择');
|
|
|
|
$plan_nmr_temp[] = $p_nmr_data;
|
|
|
|
$plan_nmr_temp[] = $p_nmr_data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -559,6 +599,7 @@ class OrderNewController extends Controller
|
|
|
|
'ZCRQ'=>$nowDateTime,
|
|
|
|
'ZCRQ'=>$nowDateTime,
|
|
|
|
'yyid'=>$yyid,
|
|
|
|
'yyid'=>$yyid,
|
|
|
|
'action'=>2,
|
|
|
|
'action'=>2,
|
|
|
|
|
|
|
|
'leixing'=>$plan_nmr['leixing']
|
|
|
|
];
|
|
|
|
];
|
|
|
|
//调用接口预约二线
|
|
|
|
//调用接口预约二线
|
|
|
|
$erxian_yuyue= $AspNet::ErXian($p_nmr_data, uniqid());
|
|
|
|
$erxian_yuyue= $AspNet::ErXian($p_nmr_data, uniqid());
|
|
|
|
@ -579,9 +620,11 @@ class OrderNewController extends Controller
|
|
|
|
'plan_id' => $plan->id,
|
|
|
|
'plan_id' => $plan->id,
|
|
|
|
'plan_number' => $plan->plan_number,
|
|
|
|
'plan_number' => $plan->plan_number,
|
|
|
|
'doctor' => $doctor,
|
|
|
|
'doctor' => $doctor,
|
|
|
|
'erxian_appointment_info'=>json_encode($plan_nmr_appointment_info, JSON_UNESCAPED_UNICODE),
|
|
|
|
|
|
|
|
'updated_at' => date('Y-m-d H:i:s')
|
|
|
|
'updated_at' => date('Y-m-d H:i:s')
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
if(!empty($plan_nmr_appointment_info)){
|
|
|
|
|
|
|
|
$data['erxian_appointment_info']=json_encode($plan_nmr_appointment_info, JSON_UNESCAPED_UNICODE);
|
|
|
|
|
|
|
|
}
|
|
|
|
$u = DB::table('orders')->where(['id' => $orderid])->update($data);
|
|
|
|
$u = DB::table('orders')->where(['id' => $orderid])->update($data);
|
|
|
|
$up_plan = DB::table('plans')->where(['id' => $plan->id, 'status' => 1])->update([
|
|
|
|
$up_plan = DB::table('plans')->where(['id' => $plan->id, 'status' => 1])->update([
|
|
|
|
'status' => 2
|
|
|
|
'status' => 2
|
|
|
|
|