ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
@@ -0,0 +1,43 @@
<?php
/**
* Copyright © All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Lts\Inventory\Block\Index;
use Lts\Inventory\Api\SourceCustomerInterface;
use Lts\Inventory\Api\SourceCustomerRepositoryInterface;
use Magento\Customer\Model\Session;
use Magento\Framework\Exception\LocalizedException;
class Index extends \Magento\Framework\View\Element\Template
{
/**
* Constructor
*
* @param \Magento\Framework\View\Element\Template\Context $context
* @param array $data
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
Session $customerSession,
SourceCustomerRepositoryInterface $sourceCustomerRepository,
array $data = []
) {
$this->customerSession = $customerSession;
$this->sourceCustomerRepository = $sourceCustomerRepository;
parent::__construct($context, $data);
}
/**
* @return \Lts\Inventory\Api\Data\SourceCustomerInterface[]
* @throws LocalizedException
*/
public function getInventorySources() {
return $this->sourceCustomerRepository->getList((string)$this->customerSession->getCustomerId())->getItems();
}
}