如何使用 bigcommerce v2 对客户列表进行排序 api
How to sort customer list by using bigcommerce v2 api
如何使用 bigcommerce v2 对客户列表进行排序 api。我做了下面的代码。
$filter = array("page" =>$page, "limit" =>50);
$customersList = $this->store->getCustomers($filter); public static function getCustomers($filter = array())
{
$filter = Filter::create($filter);
return self::getCollection('/customers'. $filter->toQuery(), 'Customer');
}
首先,我想先按 desc 中的 date_created 对整个列表进行排序,然后对其进行分页过滤。首先显示新添加的记录。
请帮我找出解决办法..
API 不支持排序,因此您必须对数组进行排序。 Laravel 支持 array_sort
。
$customers = array_values(array_sort($array, function($value)
{
return $value['date_created'];
}));
如何使用 bigcommerce v2 对客户列表进行排序 api。我做了下面的代码。
$filter = array("page" =>$page, "limit" =>50);
$customersList = $this->store->getCustomers($filter); public static function getCustomers($filter = array())
{
$filter = Filter::create($filter);
return self::getCollection('/customers'. $filter->toQuery(), 'Customer');
}
首先,我想先按 desc 中的 date_created 对整个列表进行排序,然后对其进行分页过滤。首先显示新添加的记录。 请帮我找出解决办法..
API 不支持排序,因此您必须对数组进行排序。 Laravel 支持 array_sort
。
$customers = array_values(array_sort($array, function($value)
{
return $value['date_created'];
}));