<?php

namespace App\Http\Controllers\API\H5;

use App\Http\Controllers\Controller;
use App\Services\SanFangLogService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;

class FenZhenController extends Controller
{
    public function GetTiJianLine(){
        $url="https://ccty-ct.sixinyun.com/h5/tjline.php";
        $id_number = request('id_number');
        $nonce=mt_rand(1000, 9999);
        $data=[
            "key"=>"E0934FEF-EF49-41CF-9548-3A7BE2B5A4C7",
            "id_number"=>$id_number,
            "nonce"=>$nonce
        ];
        //$response = Http::post($url,$data);
      $service=  SanFangLogService::Post($url,$data,'分诊队列'.$nonce,'分诊');
        if ($service['status']===true) {
            $res = $service['data'];
            if($res['code']==200 and $res['data']['info']['id']<>0){
                if(isset( $res['data']['info']['birthday'])){
                    $res['data']['info']['age']=\App\Lib\Tools::GetAge( $res['data']['info']['birthday']);
                }
                return \Yz::Return(true,"查询成功",$res['data']);
            }else{
                return \Yz::echoError1("未查询到该用户队列信息");
            }
        }else{
            return \Yz::echoError1("查询失败[".$nonce."]");
        }
    }
}
