following is my query how do i place what code in view ,model,controller in yii

`select productid, count(*)
from fc_member
group by productid 
order by count(*)desc
LIMIT 3`

Please let me know i am a newbie
i did try but then do not the how and what of it :( 

**controller**

```
public function actiondsplayproduct()
{
    $model=new Member;
    $dataProvider=new CActiveDataProvider('$model',
            array(
                    'criteria'=>array(
                            'select'=>'productid, COUNT( * )as Cproductid',
                            'from'=>'fc_member',
                            'group'=>'productid',
                            'order'=>'COUNT( * ) ',

                    ),
            )
    );
    $this->render('dsplayproduct',array(
            'dataProvider'=>$dataProvider,
    ));

    //$this->render('dsplayproduct',array('model'=>$model));
}

```

**view**

```
$this->widget('zii.widgets.grid.CGridView', array(
        'dataProvider'=> $dataProvider,
        'filter'=>$model,
        'columns'=>array(
                'productid',
                'Cproductid',
        )
));

```

And also get the below error

PHP warning

```
include($model.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

```

Please let me know I am a newbie

I did try but then do not know the how and what of it :( 

following r d changes

```
   model

 `public function top_selling_products() {

   $criteria = new CDbCriteria;
     $criteria->select = 'productid ,  count(*) as pid_count';

     $criteria->from='fc_member';
  $criteria->group = 'productid';
     $criteria->order = 'pid_count desc';

return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
  ));
    }`

  controoler
    `
  public function actiondsplayproduct()
  {

$dataProvider=new CActiveDataProvider('Member');
$this->render('dsplayproduct',array(
    'dataProvider'=>$dataProvider,
));

```

}
`view`
 $this->widget('zii.widgets.grid.CGridView', array(

```
   'dataProvider'=>Member::model()->top_selling_products(),
  'enablePagination' => false,
        'columns'=>array(
'pid',
  'pid_count',
    array(
    'class'=>'CButtonColumn',
      ),
       ),
 )); `

```

but i get the folowing error

Property "CDbCriteria.from" is not defined.

Plz let me now where am i wrong