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.
46 lines
1.6 KiB
PHP
46 lines
1.6 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("体检号不能为空");
|
|
}
|
|
|
|
}
|
|
}
|