我试图用订单项作为行来创建销售订单网格的克隆。
但是当将带有销售订单项目表的表加入时,其抛出错误。
项目 (Magento \ Framework \ View \ Element \ UiComponent \ DataProvider \ Document) 相同ID“ 3”已经存在。
protected function _renderFiltersBefore() {
$joinTable = $this->getTable('sales_order');
$this->getSelect()->joinLeft($joinTable,
'main_table.entity_id = sales_order.entity_id', ['coupon_code']);
$joinTableItem = $this->getTable('sales_order_item');
$this->getSelect()->join($joinTableItem,
'main_table.entity_id = sales_order_item.order_id',
['sku','price','qty_ordered']);
parent::_renderFiltersBefore();
}