public function __construct() { parent::__construct(); $jsapi_ticket = $this->redis->get('jsapi_ticket'); //var_dump($jsapi_ticket); if (empty($jsapi_ticket)) { $ret_json = $this->get_jsapi_ticket(); $ret_array = json_decode($ret_json, true); if (isset($ret_array['ticket'])) { $jsapi_ticket = $ret_array['ticket']; $this->redis->setex('jsapi_ticket', $ret_array['expires_in'] - 60, $jsapi_ticket); } } $this->jsapi_ticket = $jsapi_ticket; }