到检接口,团检屏蔽材料费,详情返回ct和核磁。改约
parent
d20a046a09
commit
fe4a354593
@ -0,0 +1,41 @@
|
|||||||
|
<?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]['体检号'],
|
||||||
|
'check_status'=>2,
|
||||||
|
'check_time'=>date('Y-m-d H:i:s')
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
return \Yz::Return(true,"",['id'=>$orderInfo->id]);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue