Magento API V2销售订单列表不起作用 [英] Magento API V2 Sales Orders List Not Working

查看:58
本文介绍了Magento API V2销售订单列表不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用API​​ V2"salesOrderList"来接收Magento中所有已下订单的列表.但是,SOAP响应向我显示了以下错误:-

I am using the API V2 "salesOrderList" for receiving a list of all the Orders which have been placed in Magento. But the SOAP Response is showing me an error as:-

Item (Mage_Sales_Model_Order) with the same id "1" already exist

我正在使用Magento Enterprise版本1.9.0.0.

I am using the Magento Enterprise version 1.9.0.0.

研究完SQL&在数据库中搜索时,我发现对于每个订单,SQL都为相同的订单实体ID提供4条记录;区别仅在于帐单和付款的名称字段运送区域.该查询还通过使用两个不同的别名(一个用于计费,另一个用于装运)使用相同的数据库表"sales_flat_order_address"执行两个左联接.据我了解,这应该是可行的,但不会发生.

After looking into the SQL & searching the database, I found that for each Order, the SQL is providing 4 records for the same Order Entity ID; with the difference being only in the name fields of the billing & shipping area. Also the query is doing two Left Joins with the same database table "sales_flat_order_address" by using two different aliases (one for billing & another for shipping). From my understanding, this should have worked, which is not happening.

任何人都可以对正在发生的事情提出建议吗?从该错误中恢复过来怎么办?

Can anyone please suggest as to what is happening & what can be done to recover from this error?

感谢您的任何帮助,并在此先感谢您.

Any help is appreciated and thanks in advance.

推荐答案

大致来说,Magento正在为您创建一个订单集合并尝试加载所有记录.此集合有一条规则,该规则只允许它为每个ID创建一个订单对象,因此,在加载其他对象时,会引发异常.

Roughly, Magento is creating an order collection for you and attempting to load all the records. This collection has a rule that only allows it to create one order object for each ID, so when your additional object is loaded an exception is thrown.

左加盟可能是个问题,但很难说出真相.您能否发布一些有关如何进行API调用的详细信息?不正确的联接通常会出现此问题.

The left joins could be the issue, but it's hard to say off the bat. Could you post a little detail on how you are making the API call? An incorrect join can often have this problem.

如果您使用的是默认代码,那么我的第一个猜测就是数据库中有错误的记录,或者这是一个升级的Magento系统,该系统在过去曾进行过错误的升级.在指向相同数据库的EE版本的干净副本上尝试此操作.如果发生相同的问题,则可能需要在数据库中摸索一下,以寻找导致数据加载问题的原因.由于已经有了查询,因此您可能希望将查询的各个部分分开,以查看某些子查询是否返回了太多数据.

If you're using the default code, my first guess would be that there are erroneous records in the database, or that this is an upgraded Magento system which had a bad upgrade in the past. Try this on a clean copy of your EE version pointing to the same database. If the same problem occurs, you may need to spelunk in the database looking for the reason for the problematic data load. Since you already have the query, you may want to separate out parts of the query to see if some subquery is returning too much data.

这篇关于Magento API V2销售订单列表不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆