You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.3 KiB
PHP
61 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\Internal;
|
|
|
|
use App\Http\Controllers\API\PEISApiController;
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class OrderController extends Controller
|
|
{
|
|
//到检
|
|
public function TJCheck()
|
|
{
|
|
$password = request('password');
|
|
$serve_id = request('serve_id');
|
|
$exam_id= request('exam_id');
|
|
if ($password !== 'YRtA1rx1iWgbpYKX') return \Yz::echoError1("校验密码失败");
|
|
$orderInfo=DB::table('orders')->where('appointment_number',$serve_id)->orderBy('id','desc')->first();
|
|
if(!$orderInfo) return \Yz::echoError1("未找到有效订单");
|
|
if(!!$exam_id){
|
|
if($orderInfo->status==1) return \Yz::echoError1("订单未付款");
|
|
if($orderInfo->status==3) return \Yz::echoError1("订单已取消");
|
|
if($orderInfo->status==4 || $orderInfo->check_status==2) return \Yz::echoError1("人员已经到检");
|
|
if($orderInfo->status==5) return \Yz::echoError1("订单已退款");
|
|
// $peis = new PEISApiController();
|
|
// $data = [
|
|
// "电话号码" => $orderInfo->phone,
|
|
// "证件号码" => $orderInfo->id_number,
|
|
// ];
|
|
// $info = $peis::Post('分诊查询体检号', $orderInfo->hospital_id,$data);
|
|
DB::table('orders')->where('id',$orderInfo->id)->update([
|
|
'status'=>4,
|
|
// 'tj_number'=>$info['data'][0]['体检号'],
|
|
'tj_number'=>$exam_id,
|
|
'check_status'=>2,
|
|
'check_time'=>date('Y-m-d H:i:s')
|
|
]);
|
|
return \Yz::Return(true,"",['id'=>$orderInfo->id]);
|
|
}else{
|
|
return \Yz::echoError1("体检号不能为空");
|
|
}
|
|
|
|
}
|
|
public function GetH5Order()
|
|
{
|
|
$appointment_number = request('appointment_number');//思信预约完成后的id
|
|
if(!isset($appointment_number) || empty($appointment_number)) return \Yz::echoError1('预约id 不能为空');
|
|
$order_info = DB::table('orders')->where(['appointment_number' => $appointment_number,'status'=>2,'check_status'=>1])->first();
|
|
if (!!$order_info) {
|
|
$order_info->buy_info = json_decode($order_info->buy_info, true);
|
|
$order_info->erxian_appointment_info = json_decode($order_info->erxian_appointment_info, true);
|
|
} else {
|
|
return \Yz::echoError1('未找到有效订单');
|
|
}
|
|
return \Yz::Return(true, '获取成功', [
|
|
'info' => $order_info
|
|
]);
|
|
}
|
|
}
|