我正在尝试使用Savon和Magento API将订单从Magento商店导入到rails应用程序。到目前为止,这是我的代码:
require 'savon'
client = Savon.client(wsdl: "http://mywebsite.com/api/v2_soap?wsdl")
session_id = client.call(:login,
message: {
username: "myapiuser",
api_key: "myapipassword"
}).body[:login_response][:login_return]
orders = client.call(:sales_order_list,
message: {
session_id: session_id, complex_filters: [{
key: "created_at", operator: "gt", value: '2014-10-14 00:00:00' }]
})
我需要使用复杂的过滤器来查找在特定日期之后创建的订单。这样做的原因是,如果我试图立即拉出所有订单,它会使服务器超载。我尝试使用上面的复杂过滤器,但它仍然试图拉出所有订单。我是否以不正当的方式通过过滤器?关于如何使这项工作的任何想法?