php - count in model scopes() function -
i'm trying count total matches found in scopes , scope works , returns every other column, except count() public function scopes() { return array( 'test'=> array( 'alias' => 'd', 'select'=> array('d.id, d.picture, d.store, d.address, d.postcode, d.city, d.state, count(*) totalads'), 'join' => 'join `ads` v', 'condition'=>'d.is_new="0" , v.pending!="1" , d.id = v.id', 'group'=>'v.id' ), } in view i'm trying data using $data->totalads error when use print_r($data->totalads) the error property "store.totalads" not defined. i'm using yii 1.1.15 as error states, totalads not defined. you define totalads statistical relation in class...