我需要一些关于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?
答案 0 :(得分:1)
以这种方式发送参数,希望它对您有用
$params = array('complex_filter' => array(
array(
'key' => 'created_at',
'value' => array(
'key' => 'from',
'value' => '2019-01-01'
),
),
array(
'key' => 'created_at',
'value' => array(
'key' => 'to',
'value' => '2019-06-21'
),
),
));