private function buildRevenueData(array $result, $detailed = false)
    {
        $data = [];

        foreach ($result as $r) {
            $data[$r['date']] = $detailed ? json_decode($r['details'], true) : $r['revenue'];
        }

        return $data;
    }
private function buildRevenueData(array $result, $detailed = false)
    {
        $data = [];

        foreach ($result as $r) {
            $data[$r['date']] = $detailed ? json_decode($r['details'], true) : $r['revenue'];
        }

        return $data;
    }
private function buildRevenueData ( array $ result , $ detailed = false ) { $ data = [ ] ; foreach ( $ result as $ r ) { $ data [ $ r [ 'date' ] ] = $ detailed ? json_decode ( $ r [ 'details' ] , true ) : $ r [ 'revenue' ] ; } return $ data ; }
Builds the revenue data.

@param array $result
@param bool  $detailed

@return array
Builds the revenue data .