【问题标题】:Sales Order Grid issue in Magento 2.4.2: Column not foundMagento 2.4.2 中的销售订单网格问题:找不到列
【发布时间】:2021-04-29 08:35:31
【问题描述】:

在销售订单网格的管理员中,我收到以下错误。请指导:

Column not found: 1054 Unknown column 'allocated_sources' in 'order clause', query was: SELECT `main_table`.*, group_concat(sales_order_item.sku SEPARATOR ", ") AS `skus`, group_concat(sales_order_item.name SEPARATOR ",") AS `names`, `braintree_transaction_details`.`transaction_source` FROM `sales_order_grid` AS `main_table`
 LEFT JOIN `sales_order_item` ON sales_order_item.order_id = main_table.entity_id
 LEFT JOIN `braintree_transaction_details` ON braintree_transaction_details.order_id = main_table.entity_id GROUP BY `main_table`.`entity_id` ORDER BY allocated_sources ASC

我在网格中有一个额外的列,即分配的源。

【问题讨论】:

  • 我有同样的问题 SQLSTATE[42S22]: Column not found: 1054 Unknown column 'allocated_sources' in 'order Clause',查询是:SELECT main_table.*, braintree_transaction_details.@987654324 @ FROM sales_order_grid AS main_table LEFT JOIN braintree_transaction_details ON braintree_transaction_details.order_id = main_table.entity_id ORDER BY assigned_sources ASC LIMIT 200 /var/www/html/vendor/magento/framework/DB/Statement/Pdo/Mysql 中的异常.php:110
  • 我已更改用户的角色,此错误通过更改用户权限自动解决

标签: magento magento2


【解决方案1】:

我得到了同样的解决方案。 只需覆盖模块销售订单网格并添加以下代码。升级您的模块并刷新缓存。它会起作用的。

1 - 使用 Magento 标准创建一个新模块 2 - 使用此内容视图/adminhtml/ui_component/sales_order_grid.xml 覆盖文件

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="allocated_sources"
                class="Magento\InventoryShippingAdminUi\Ui\Component\Listing\Column\AllocatedSources"
                component="Magento_InventoryShippingAdminUi/js/order/grid/cell/allocated-sources">
            <settings>
                <filter>false</filter>
                <label translate="true">Allocated sources</label>
                <sortable>false</sortable>
            </settings>
        </column>
    </columns>
</listing>

您的问题将得到解决。 谢谢, 拉什

【讨论】:

    【解决方案2】:

    请检查您数据库中的“allocated_sources”列。我猜它还没有被创建或者你加入了错误的表。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多