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("体检号不能为空"); } } }