getGuid(); } protected function getGuid(){ $options = [ 'cache_wsdl' => WSDL_CACHE_NONE, 'trace' => 1, 'stream_context' => stream_context_create( [ 'ssl' => [ 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ] ] ) ]; $redis = \app\common\Redis::instance(\think\facade\Config::get("cache.stores.redis.select")); $guid= $redis->get("jjdata_guid"); if(!$guid || empty($guid)) { $client = new \SoapClient("http://110.88.153.177:802/ConvergenceServiceBoot/webservice/Authentication?wsdl", $options); $param = [ 'userid' => 'jjswzzb_sbxt', 'password' => 'sbxt@2022' ]; $rst = $client->loginByAccount($param); $ret = json_decode($rst->return, true); if($ret['code'] == '01'){ $this->guid = $ret['data']; $redis->set("jjdata_guid",$this->guid,1700); }else{ $this->guid = ''; } }else{ $this->guid = $guid; } } public function InsuranceRecordSearch($card,$start,$end){ $this->getGuid(); $options = [ 'cache_wsdl' => WSDL_CACHE_NONE, 'trace' => 1, 'stream_context' => stream_context_create( [ 'ssl' => [ 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ] ] ) ]; $client = new \SoapClient("http://110.88.153.177:802/ConvergenceServiceBoot/webservice/InsuranceRecordSearch?wsdl", $options); $param = [ 'guid' => $this->guid, 'requestid' => 'null_00001', 'id' => $card, 'startTime' => $start, 'endTime' => $end ]; $rst = $client->queryUnemploymentInsuranceByIdAndTime($param); $ret = json_decode($rst->return, true); if($ret['code'] == '01'){ dd($ret); }else{ $this->guid = ''; } } }