我正在使用 WooCommerce rest api v1,我试图在其中获取 2016 年 6 月创建的所有客户。这是我正在使用的代码:-
$customers = $woocommerce->get('customers', array( 'filter[date_created_min]' => '2016-06-01', 'filter[date_created_max]' => '2016-06-30' ) ) ;
不幸的是,它返回了所有记录并忽略了过滤器。以下是它在数组中返回的 1 条记录的示例:-
Array
(
[id] => 3
[date_created] => 2016-08-08T15:26:49
[date_modified] => 2016-08-10T22:17:44
[email] => manager@manager.com
[first_name] => Shop
[last_name] => Manager
[username] => Manager
[last_order] => Array
(
[id] =>
[date] =>
)
[orders_count] => 0
[total_spent] => 0.00
[avatar_url] => http://2.gravatar.com/avatar/?s=96
[billing] => Array
(
[first_name] => shop
[last_name] => manager
[company] => test company 1
[address_1] => test
[address_2] =>
[city] => test
[state] => PB
[postcode] => 1111
[country] => test
[email] => shop@manager.com
[phone] => 123456
)
[shipping] => Array
(
[first_name] => shop
[last_name] => manager
[company] => test company 1
[address_1] => test
[address_2] =>
[city] => test
[state] => PB
[postcode] => 11111
[country] => test
)
请帮助我知道正确的日期过滤器。我已经尝试过 'created_at_min' / 'created_at_max' 但它不起作用。提前致谢!