【问题标题】:Why Magento salesOrderInvoiceList is accepting store_id as a Complex filter?为什么 Magento salesOrderInvoiceList 接受 store_id 作为复杂过滤器?
【发布时间】:2015-12-11 15:23:05
【问题描述】:

我必须更新另一个程序员创建的代码。 它使用 php - SOAP 来连接 Magento。 我正在挖掘以了解他的所作所为,我发现了一个使用复杂过滤器的查询 反对 sales_order_invoice.info。 这是复杂过滤器:

$complexFilter = array(            
      'complex_filter' => array(
        array(
               'key' => 'CREATED_AT',
               'value' => array(
                   'key' => 'from',
                   'value' => '2015-10-16 01:24:37'
               )
        ),
        array(
               'key' => 'state',
               'value' => array(
                   'key' => '=',
                   'value' => '2'
               )
        ),
        array(
               'key' => 'store_id',
               'value' => array(
                   'key' => 'in',
                   'value' => '5,6'
               )
        )
      )
);

这是连接代码:

$cli = new SoapClient("http://MYstaging.com/api/v2_soap/?wsdl");
$username = 'myuser';
$password = 'myPass';
$session_id = $cli->login($username, $password);
#$cli->__setCookie('XDEBUG_SESSION', 'netbeans-xdebug');      
$result = $cli->salesOrderInvoiceList($session_id, $complexFilter);

正如我们所见,查询应该从 salesOrderInvoiceList 中检索一些信息,而且确实如此。 结果如下:

array (size=1)
  0 => 
    object(stdClass)[2]
      public 'increment_id' => string '500000001' (length=9)
      public 'created_at' => string '2015-10-16 20:07:18' (length=19)
      public 'order_currency_code' => string 'YYY' (length=3)
      public 'order_id' => string '9' (length=1)
      public 'state' => string '2' (length=1)
      public 'grand_total' => string '00.0000' (length=7)
      public 'invoice_id' => string '3' (length=1)

我不明白这一点。如果我们检查 Magendo 文档到 sales_order_invoice.list,则没有 store_id 内容或领域。所以应该不可能将其用作过滤器。 但它确实存在于sales_order_invoice.info

好吧,如果我将“store_id”字段更改为根本不存在的东西, 可以说“BLAH_BLAH”当然我不会有任何结果。这就是正在发生的事情。这是有道理的。在幕后可能我们有一个 sql 1054 (Unknow column) 错误。

$complexFilter = array(            
      'complex_filter' => array(
        array(
               'key' => 'CREATED_AT',
               'value' => array(
                   'key' => 'from',
                   'value' => '2015-10-16 01:24:37'
               )
        ),
        array(
               'key' => 'state',
               'value' => array(
                   'key' => '=',
                   'value' => '2'
               )
        ),
        array(
               'key' => 'BLAH_BLAH',
               'value' => array(
                   'key' => 'in',
                   'value' => '5,6'
               )
        )
      )
);

谁能解释一下为什么 salesOrderInvoiceList 接受 store_id 作为过滤器?

【问题讨论】:

    标签: php magento soap


    【解决方案1】:

    好吧,在此处被否决后,我已在 Magento StackExchange 中发帖。 结论是文档中可能存在差距。 Post.

    【讨论】:

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