嗨,我在 2.0 中使用 Countercache,我需要添加一些条件,如下所示。但它不起作用..如果'counterCache'=> true,它会增加字段,它不考虑我添加的条件。
Post hasMany WallPost
WallPost 属于 Post
public $belongsTo = array(
'WallPost' => array(
'className' => 'WallPost',
'foreignKey' => 'wallpost_id',
'counterScope' =>array(
'WallPost.post_id' =>3,
),
'fields' => '',
'order' => '',
'counterCache' => true
),