Wednesday, September 2, 2009

Re: problem with recursive join from stats table

It must be somehow connected with "fields" parameter - when I dont use
it, cake does multiple join. But when I add 'fields'=>array
('Campaign.campaignname','SUM( StatsHourly.impressions ) AS
impressions',(...)) into the find method call cake does only first
level joins and I get sql error "Unknown column
'Campaign.campaignname' in 'field list'"..


On 2 Wrz, 13:27, Ace <konradkrakow...@go2.pl> wrote:
> Hi,
>
> In my adserver's database I have ad impressions stas in table named
> data_summary_ad_hourly. Model for this table is named StatsHourly and
> it "belongsTo" Banner and Zone model. Banner model belongsTo Campaign
> model and Zone model belongs to Publisher model. It's all quite
> logical. Now I would like to find all stats from some period of time -
> I did set recursive to 2 and called find('all') with conditions on
> StatsHourly model. Result contains info about zone and banner but
> doesn't say anything about associated Campaign and Publisher. Why is
> that? It seems that recursive joins are not working for some reason,
> but I don;t know why.. I called $this->Banner->find('all') to check if
> the relation between Banner and Campaign is ok - result contained
> Campaign info so it's ok.
>
> Can it be because I use fields parameter with SUM and other sql
> functions?
>
> Thanks for any help
> Konrad
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: