|
|
|
|
@ -391,6 +391,7 @@ class OrderController extends Controller
|
|
|
|
|
'name' => $plan_nmr['name'],
|
|
|
|
|
'date' => substr($plan_nmr['time'], 0, 10),
|
|
|
|
|
'time' => substr($plan_nmr['time'], 10, 5),
|
|
|
|
|
'price' => $plan_nmr['price'],
|
|
|
|
|
];
|
|
|
|
|
//调用接口校验号源是否可用
|
|
|
|
|
$erxian_status = $AspNet::ErXian(['YYRQ' => $p_nmr_data['date'], 'YYSJ' => $p_nmr_data['time'], 'yyid' => $yyid, 'action' => 4], uniqid());
|
|
|
|
|
@ -579,8 +580,33 @@ class OrderController extends Controller
|
|
|
|
|
//最后步骤,开始通知思信预约
|
|
|
|
|
public function Finish($order_number)
|
|
|
|
|
{
|
|
|
|
|
$AspNet=new AspNetZhuanController();
|
|
|
|
|
$order_info = DB::table('orders')->where(['order_number' => $order_number])->first();
|
|
|
|
|
if (!$order_info) return ['status' => false, 'msg' => "未找到有效订单。"];
|
|
|
|
|
$yyid=6;
|
|
|
|
|
if($order_info->hospital_id == 1){
|
|
|
|
|
$yyid=6;
|
|
|
|
|
}
|
|
|
|
|
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' => 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'] . '号源不可用');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$buy_info = json_decode($order_info->buy_info, true);
|
|
|
|
|
$combo_id = $buy_info['combo']['id'];
|
|
|
|
|
$item_arr = [];
|
|
|
|
|
@ -656,7 +682,8 @@ class OrderController extends Controller
|
|
|
|
|
//查询确认订单已经是支付状态
|
|
|
|
|
$cha = DB::table('orders')->where(['order_number' => $order_number, 'status' => 2])->first();
|
|
|
|
|
if (!$cha) return ['status' => false, 'msg' => "订单未支付,禁止预约"];
|
|
|
|
|
//把状态更新为支付后,然后再开始预约思信
|
|
|
|
|
//把状态更新为支付后,先二线,然后再开始预约思信
|
|
|
|
|
|
|
|
|
|
$create_appointment = self::create_appointment($order_info->hospital_id, $cad);
|
|
|
|
|
|
|
|
|
|
if (!isset($create_appointment['data'][0][0])) return ['status' => false, 'msg' => "体检预约,返回非预期结果"];
|
|
|
|
|
|