查询商品信息
@param string $keystandard 商品编码标准
@param string $keystr 商品编码内容
@return array
@throws Exceptions\InvalidResponseException
@throws Exceptions\LocalCacheException
774692
public function getProduct($keystandard, $keystr)
    {
        $data = ['keystandard' => $keystandard, 'keystr' => $keystr];
        empty($extinfo) || $data['extinfo'] = $extinfo;
        $url = "https://api.weixin.qq.com/scan/product/get?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
416827
protected function seeList($keySingle, $keyPlural, $list)
    {
        $key = is_array($list) && count($list) > 1 ? $keyPlural : $keySingle;
        $sList = $this->listToString($list);
        return sprintf($this->t($key), $sList);
    }
470278
public function getAddrSign($url, $timeStamp, $nonceStr, $user_token=''){
		if (!$user_token) $user_token = $this->user_token;
		if (!$user_token) {
			$this->errMsg = 'no user access token found!';
			return false;
		}
		$url = htmlspecialchars_decode($url);
		$arrdata = array(
				'appid'=>$this->appid,
				'url'=>$url,
				'timestamp'=>strval($timeStamp),
				'noncestr'=>$nonceStr,
				'accesstoken'=>$user_token
		);
		return $this->getSignature($arrdata);
	}
246303
public function quotes($quoteStr, $type = \PDO::PARAM_STR)
    {
        if ($quoteStr instanceof \Closure || is_resource($quoteStr)) {
            throw new \InvalidArgumentException(
                "Invalid value to be quote, quote value could not be instance of `Closure` or as a `Resource`",
                E_USER_ERROR
            );
        }

        $quoteStr = $this->trimTableSelector($quoteStr);
        if (is_array($quoteStr)) {
            foreach ($quoteStr as $key => $value) {
                $quoteStr[$key] = $this->quotes($value, $type);
            }
            return $quoteStr;
        } elseif (is_object($quoteStr)) {
            foreach (get_object_vars($quoteStr) as $key => $value) {
                $quoteStr->{$key} = $this->quotes($value, $type);
            }
            return $quoteStr;
        }

        return $this->quote($quoteStr);
    }
1185527
public void remove(String keyStr) {

    List<String> keys = split(keyStr, '.');
    int numKeys = keys.size();

    CollectionData collectionData = this;
    for (int i = 0; i <= numKeys - 2; ++i) {
      SoyData soyData = collectionData.getSingle(keys.get(i));
      if (!(soyData instanceof CollectionData)) {
        return;
      }
      collectionData = (CollectionData) soyData;
    }

    collectionData.removeSingle(keys.get(numKeys - 1));
  }
441223
private static function _buildConfigArray($keyId = null, $secret = null, $region = null)
    {
        $config = [
            'region' => $region,
            'version' => 'latest'
        ];

        if (empty($keyId) || empty($secret)) {
            // Assume we're running on EC2 and we have an IAM role assigned. Kick back and relax.
        } else {
            $tokenKey = static::CACHE_KEY_PREFIX . md5($keyId . $secret);
            $credentials = new Credentials($keyId, $secret);

            if (Craft::$app->cache->exists($tokenKey)) {
                $cached = Craft::$app->cache->get($tokenKey);
                $credentials->unserialize($cached);
            } else {
                $config['credentials'] = $credentials;
                $stsClient = new StsClient($config);
                $result = $stsClient->getSessionToken(['DurationSeconds' => static::CACHE_DURATION_SECONDS]);
                $credentials = $stsClient->createCredentials($result);
                Craft::$app->cache->set($tokenKey, $credentials->serialize(), static::CACHE_DURATION_SECONDS);
            }

            // TODO Add support for different credential supply methods
            $config['credentials'] = $credentials;
        }

        $client = Craft::createGuzzleClient();
        $config['http_handler'] = new GuzzleHandler($client);

        return $config;
    }
617226
@Deprecated
	public String encryptStr(String data, KeyType keyType) {
		return encryptBcd(data, keyType, CharsetUtil.CHARSET_UTF_8);
	}
156670
private function parseNameFromKeyDefinition($strKeyDefinition)
    {
        $strKeyDefinition = trim($strKeyDefinition);

        $intPosition = strpos($strKeyDefinition, '(');

        if ($intPosition === false) {
            throw new \Exception("Invalid Key Definition: $strKeyDefinition");
        } else {
            if ($intPosition == 0) // No Key Name Defined
            {
                return null;
            }
        }

        // If we're here, then we have a key name defined
        $strName = trim(substr($strKeyDefinition, 0, $intPosition));

        // Rip Out leading and trailing "`" character (if applicable)
        if (substr($strName, 0, 1) == '`') {
            return substr($strName, 1, strlen($strName) - 2);
        } else {
            return $strName;
        }
    }
1015795
public function getResponseValue(array $plaintextResponseHeader, $key): ?string
    {
        if (isset($plaintextResponseHeader[$this->formatKey($key)])) {
            return $plaintextResponseHeader[$this->formatKey($key)];
        }

        return null;
    }
333807
public String get(String keyStr) {
        String result = null;
        try {
            DatabaseEntry key = new DatabaseEntry(keyStr.getBytes("UTF-8"));
            DatabaseEntry data = new DatabaseEntry();
            if (db.get(null, key, data, LockMode.DEFAULT) == 
            	OperationStatus.SUCCESS) {
            	
                byte[] bytes = data.getData();
                result = new String(bytes, "UTF-8");
            }
         } catch (DatabaseException e) {
             e.printStackTrace();
         } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return result;
    }
728670
public function mGet(array $keyArray)
    {
        $result = [];
        foreach ($keyArray as $key) {
            $v = $this->get($key);
            if (null != $v) {
                $result[$key] = $v;
            }
        }

        return $result;
    }
82254
protected function parseCsvString($str)
    {
        if (! isset($this->optionsIndexMap) || ! is_array($this->optionsIndexMap) || empty($this->optionsIndexMap)) {
            throw new \InvalidArgumentException(sprintf(
                'Class %s is missing the `optionsIndexMap` property',
                get_class($this)
            ));
        }

        $options = explode(',', $str);
        $result  = array();
        foreach ($options as $k => $v) {
            if (! isset($this->optionsIndexMap[$k])) {
                throw new \InvalidArgumentException(sprintf(
                    'Class %s does not have the index %d configured in the `optionsIndexMap` property',
                    get_class($this),
                    $k
                ));
            }
            $result[$this->optionsIndexMap[$k]] = $v;
        }

        return $this->convertBooleanStrings($result);
    }
525370
final public function queryArrayKey(string $query, string $keyField, string $keyPrefix = '')
    {
        $result = $this->queryResult($query);
        if (false === $result) {
            return false;
        }

        $return = [];
        while ($row = $result->fetchRow()) {
            if (! array_key_exists($keyField, $row)) {
                return false;
            }
            $return[$keyPrefix . $row[$keyField]] = $row;
        }
        return $return;
    }
416185
public function clearScanTicket($keystandard, $keystr, $extinfo)
    {
        $url = "https://api.weixin.qq.com/scan/scanticket/check?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['keystandard' => $keystandard, 'keystr' => $keystr, 'extinfo' => $extinfo]);
    }
917902
public function get($url, $keysArr){
        $combined = $this->combineURL($url, $keysArr);
        return $this->get_contents($combined);
    }
1289729
protected function getKeysForSource(int $sourceId): \Traversable
    {
        $row = $this->getRow($sourceId);
        foreach ($this->extractors as $extractor) {
            switch (true) {
                case $extractor instanceof MultiStringExtractorInterface:
                    foreach ($extractor->keys($row) as $key) {
                        yield $extractor->name() . '.' . $key;
                    }
                    break;
                case $extractor instanceof ExtractorInterface:
                    if ($extractor->supports($row)) {
                        yield $extractor->name();
                    }
                    break;
                default:
                    throw new \InvalidArgumentException('Unknown extractor type ' . \get_class($extractor));
            }
        }
    }
527305
function kget($keyid)
	{
		if($this->if_cache) $cache_data = $this->cache->get($this->cache_prefix.$keyid);
		else $cache_data = false;
		if($cache_data) return $cache_data;
		else
		{
			$get['keyid'] = $keyid;
			$get['limit'] = 1;
			$data = $this->gets($get);
			if($this->if_cache) $this->cache->set($this->cache_prefix.$keyid,$data[0],$this->expire);
			return $data[0];
		}
	}