Public Member Functions | |
setDateRange ($from, $to) | |
setStoreIds ($storeIds) |
Definition at line 35 of file Collection.php.
setDateRange | ( | $ | from, | |
$ | to | |||
) |
Definition at line 38 of file Collection.php.
00039 { 00040 $this->_reset() 00041 ->addAttributeToSelect('*') 00042 ->addAttributeToFilter('created_at', array('from' => $from, 'to' => $to)) 00043 ->addExpressionAttributeToSelect('orders', 'COUNT(DISTINCT({{entity_id}}))', array('entity_id')) 00044 ->addAttributeToSelect('shipping_description') 00045 ->groupByAttribute('shipping_description') 00046 ->getSelect()->order('orders desc'); 00047 00048 $this->getSelect()->where("`_table_shipping_description`.`value` <> ''"); 00049 return $this; 00050 }
setStoreIds | ( | $ | storeIds | ) |
Definition at line 52 of file Collection.php.
00053 { 00054 $vals = array_values($storeIds); 00055 if (count($storeIds) >= 1 && $vals[0] != '') { 00056 $this->addAttributeToFilter('store_id', array('in' => (array)$storeIds)); 00057 $this->addExpressionAttributeToSelect('total', 00058 'SUM({{base_shipping_amount}})', 00059 array('base_shipping_amount')); 00060 } else { 00061 $this->addExpressionAttributeToSelect('total', 00062 'SUM({{base_shipping_amount}}*{{base_to_global_rate}})', 00063 array('base_shipping_amount', 'base_to_global_rate')); 00064 } 00065 00066 return $this; 00067 }