Signatur | string dk__sales_statistics( string $sid, int $id, string $type, statistics_params $params ) |
Parameter |
|
Returns | string array( 'ok'=>TRUE/FALSE, 'error'=>string error text, 'data'=>array statistics data as array ) |
Description | sales statistics for customer the parameter array $params has to be used to limit the time period for the statistics: year:int has to be a valid year value, for example 2008 timeframe:string possible values => year | quarter | month | week | free startdate:string depends on the timeframe value timeframe=year => startdate can be set to: '' timeframe=quarter => startdate can be set to: 1 - 4 timeframe=month => startdate can be set to: 1 - 12 timeframe=week => startdate can be set to: 1 - 52 timeframe=free => startdate can be set to: mysql timestamp format, for example '2008-02-29' enddate:string depends on the timeframe value timeframe=year|quarter|month|week => enddate can be set to: '' timeframe=free => enddate can be set to: mysql timestamp format, for example '2008-04-15' keep in mind to specify every single parameter. for parameters you don't want to use, strings should be given an empty value ('') and integers should be set to null the returned array on success contains the statistics data array (accessible by the key 'data') with the following structure: type='wg' array( array( product group id, volume of sales ) ) type='' array( array( volume of sales ) ) |