获取指定时间之后的有更新的所有products collection
至于api配置部分就不再重复,想看配置custom api请点击:magento custom api configuration
/*
* List of product that has been created or updated since a date
*
* @param string $date
* @param int $store
* @return array
*/
public function getupdatedproducts($date,$store= null){
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToFilter('updated_at', array(
'from' => $date,
));
$collection->addAttributeToSelect('sku');
$collection->addAttributeToSort('updated_at', 'desc');
$result = array();
$i = 0;
foreach ($collection as $product){
$result[$i]['sku'] = $product['sku'];
$i++;
}
return $result;
}
That's all,thank you!