【问题标题】:How Two date range filters in Magento SOAPMagento SOAP 中的两个日期范围过滤器
【发布时间】:2015-11-21 20:45:04
【问题描述】:

我需要一些有关 Magento SOAP (Webservice) 中日期范围过滤器的帮助。

<?php
$client = new SoapClient('http://website/index.php/api/v2_soap?wsdl=1');
$apiuser="user";
$apikey="passwd";

$sess_id= $client->login($apiuser, $apikey);

$params = array( 'filter' => array(
array('key' => 'created_at','value' => array(
'from' => '2015-07-13 00:00:00',
'to' => '2015-07-13 23:59:59'))));

$vend=$client->salesOrderList($sess_id, $params);

print_r($vend);

?>

我尝试使用complex_filter,但出现分段失败。

有人有日期范围过滤器的工作示例吗?用soap v1还是v2更好?

【问题讨论】:

    标签: php magento soap


    【解决方案1】:

    以这种方式发送参数我希望它对你有用

    $params = array('complex_filter' => array(
                    array(
                        'key' => 'created_at',
                        'value' => array(
                            'key' => 'from',
                            'value' => '2019-01-01 00:00:00'
                        ),
                    ),
    
                        array(
                        'key' => 'created_at',
                        'value' => array(
                            'key' => 'to',
                            'value' => '2019-06-21 23:59:59'
                        ),
                    ),
                ));
    

    【讨论】:

      猜你喜欢
      • 2013-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-03
      • 1970-01-01
      • 2017-04-25
      • 2016-06-06
      • 1970-01-01
      相关资源
      最近更新 更多