Magento2:每个商店的配置数据值错误

Magento2: wrong config data value per store

我正在尝试获取一些 Magento2 自定义 core_config_data 值,如其他主题中所述,但我有一些与商店 ID 相关的错误值。我会尽力解释,让我们从一些相关代码开始:

public function __construct(
  \Psr\Log\LoggerInterface $logger,
  \Magento\Store\Model\StoreManagerInterface $storeManager,
  \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) {..}

  {
    $store = $this->storeManager->getStore();
    $this->logger->debug($store->getId() . ": " . $store->getCode());
    $message = $this->scopeConfig->getValue(self::CONF_MESSAGE,
      \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    $link = $this->scopeConfig->getValue(self::CONF_LINK,
      \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

这里发生的是 商店 ID商店代码 正确。 在日志中我看到

main.DEBUG: 3: tedesco

我在$message$link中得到的值不正确:它们是另一个商店的值(正确的商店ID应该是3如调试日志所示,但该值是 ID 为 1 的商店中的值)。

当然我已经检查了数据库,值很好,如图所示:

Magento 2.1.4.

有什么提示吗?

提前致谢。

如果将商店或商店 ID 传递给第三个参数会发生什么情况?

$message = $this->scopeConfig->getValue(self::CONF_MESSAGE,
  \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store);