こんにちは私は2.0でCountercacheを使用しています。次のようにいくつかの条件を追加する必要があります。しかし、それは機能していません。'counterCache' => trueの場合、フィールドをインクリメントします。追加した条件は考慮されません。
投稿hasManyWallPost
WallPostはPostに属しています
public $belongsTo = array(
'WallPost' => array(
'className' => 'WallPost',
'foreignKey' => 'wallpost_id',
'counterScope' =>array(
'WallPost.post_id' =>3,
),
'fields' => '',
'order' => '',
'counterCache' => true
),