Hi All,
i am trying to execute complex query like this,
$storeDates = $this->CampaignStoreDate->find('all',
array('joins' => array(
array(
'type' => 'INNER',
'table' => 'campaigns',
'alias' => 'cp',
'foreignKey' => false,
'conditions' => array(
'cp.campaign_id = CampaignStoreDate.campaign_id')
),
array(
'type' => 'INNER',
'table' => 'stores',
'alias' => 'Store',
'foreignKey' => false,
'conditions' => array(
'Store.store_id = CampaignStoreDate.store_id')
)
),
'conditions' =>
array(
'CampaignStoreDate.date between ? and ?'=>
array($strDate,$endDate),
)));
in this i am using 3 tables CampaignStoreDate ,campaigns,stores the
condition what i am checking is working fine the array format i am
getting is,
Array
(
[0] => Array
(
[CampaignStoreDate] => Array
(
[campaign_store_id] => 381
[campaign_id] => 87
[media_id] => 4
[store_cluster_id] => 0
[store_id] => 2
[date] => 2010-06-15
[active] => 0
[deleted] => 0
)
[Store] => Array
(
)
[Campaign] => Array
(
)
)
[1] => Array
(
[CampaignStoreDate] => Array
(
[campaign_store_id] => 388
[campaign_id] => 105
[media_id] => 2
[store_cluster_id] => 0
[store_id] => 10
[date] => 2010-06-15
[active] => 0
[deleted] => 0
)
[Store] => Array
(
)
[Campaign] => Array
(
)
)
)
in this Store and Campaign tables data is not coming i nead Store data
in my view file help me.
Thanks in advance
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en