如何解决在发票网格 magento 2.3.2 中显示订购的产品列表
app\code\Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection.PHP
<?PHP
/**
* copyright © Magento,Inc. All rights reserved.
* See copYING.txt for license details.
*/
namespace Magento\Sales\Model\ResourceModel\Order\Invoice\Grid;
use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Magento\Sales\Ui\Component\DataProvider\Document;
use Psr\Log\LoggerInterface as Logger;
class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult
{
/**
* @inheritdoc
*/
protected $document = Document::class;
/**
* Initialize dependencies.
*
* @param EntityFactory $entityFactory
* @param Logger $logger
* @param FetchStrategy $fetchStrategy
* @param EventManager $eventManager
* @param string $mainTable
* @param string $resourceModel
*/
public function __construct(
EntityFactory $entityFactory,Logger $logger,FetchStrategy $fetchStrategy,EventManager $eventManager,$mainTable = 'sales_invoice_grid',$resourceModel = \Magento\Sales\Model\ResourceModel\Order\Invoice::class
) {
parent::__construct($entityFactory,$logger,$fetchStrategy,$eventManager,$mainTable,$resourceModel);
}
protected function _renderFiltersBefore()
{
$joinTable = $this->getTable('sales_order_address');
$this->getSelect()->joinLeft($joinTable,"main_table.order_id =
{$joinTable}.parent_id AND {$joinTable}.address_type = 'billing'",['telephone','city','region','country_id']);
parent::_renderFiltersBefore();
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。