|
|
|
|
@ -317,7 +317,8 @@ class OrderController extends Controller
|
|
|
|
|
|
|
|
|
|
public function Finish_test() //删除!!!
|
|
|
|
|
{
|
|
|
|
|
self::Finish('20240915183440999WMp2yu');
|
|
|
|
|
$f=self::Finish('20240916144857398k3fL9K');
|
|
|
|
|
dd($f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//最后步骤,开始通知思信预约
|
|
|
|
|
@ -344,7 +345,7 @@ class OrderController extends Controller
|
|
|
|
|
'可选项目信息' => $item_arr,
|
|
|
|
|
]);
|
|
|
|
|
if (count($item_check['data']) != 1) {
|
|
|
|
|
return \Yz::echoError1("体检系统提示:" . $item_check['message']);
|
|
|
|
|
return ['status' => false, 'msg' => "体检系统提示:" . $item_check['message']];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//如果是个检
|
|
|
|
|
@ -378,7 +379,38 @@ class OrderController extends Controller
|
|
|
|
|
'status' => 2,
|
|
|
|
|
'pay_time' => date('Y-m-d H:i:s'),
|
|
|
|
|
]);
|
|
|
|
|
//先把状态更新为支付,然后再开始预约思信
|
|
|
|
|
//把状态更新为支付后,然后再开始预约思信
|
|
|
|
|
$create_appointment = self::create_appointment($order_info->hospital_id, $cad);
|
|
|
|
|
|
|
|
|
|
if(!isset($create_appointment['data'][0][0])) return ['status' => false, 'msg' => "体检预约,返回非预期结果"];
|
|
|
|
|
|
|
|
|
|
//预约完成后查询预约结果
|
|
|
|
|
$appointment_info = self::appointment_info($order_info->hospital_id, [
|
|
|
|
|
'type' => $order_info->type,
|
|
|
|
|
"证件号码" => null,
|
|
|
|
|
"电话号码" => null,
|
|
|
|
|
"预约Id" => $create_appointment['data'][0][0],
|
|
|
|
|
]);
|
|
|
|
|
DB::table('orders')->where(['order_number' => $order_number])->update([
|
|
|
|
|
'appointment_number' => $create_appointment['data'][0][0],
|
|
|
|
|
'appointment_back_info'=> json_encode($appointment_info['data'][0], JSON_UNESCAPED_UNICODE)
|
|
|
|
|
]);
|
|
|
|
|
return ['status' => true, 'msg' => "完成"];
|
|
|
|
|
}
|
|
|
|
|
public function create_appointment($hospital, $data)
|
|
|
|
|
{
|
|
|
|
|
$peis = new PEISApiController();
|
|
|
|
|
$url_code = $data['type'] == 1 ? '个检预约' : '团检预约';
|
|
|
|
|
unset($data['type']);
|
|
|
|
|
$info = $peis::Post($url_code, $hospital, $data);
|
|
|
|
|
return $info;
|
|
|
|
|
}
|
|
|
|
|
public function appointment_info($hospital, $data)
|
|
|
|
|
{
|
|
|
|
|
$peis = new PEISApiController();
|
|
|
|
|
$url_code = $data['type'] == 1 ? '个检预约查询' : '团检预约查询';
|
|
|
|
|
unset($data['type']);
|
|
|
|
|
$info = $peis::Post($url_code, $hospital, $data);
|
|
|
|
|
return $info;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|