marypretty 2012-10-09 11:03:01 3197次浏览 2条回复 0 0 0

如下图,我要做成这样子,用YII的widgets怎么实现呢? [attach]951[/attach]

在controller的代码如下: $sql = "select * from goods ,change_order where goods.good_id=change_order.good_id";

$count = ChangeOrder::model()->findBySql($sql)->count();  	
$condition=' and c.user_id=:user_id';
$params=array(':user_id'=>Yii::app()->user->userinfo['user_id']);
$sql='select g.good_name,c.user_change_date,c.vip_code,c.change_order_status 
from goods g,change_order c where g.good_id=c.good_id '.$condition.' order by c.create_time ';
//print $sql;
$sql_provider = new CSqlDataProvider($sql, array(
    'keyField'=>'g.good_id',   
    'params'=>$params,
    'totalItemCount'=>$count,    //分页必须指定总记录数
    'pagination'=>array(
        'pageSize'=>10,
    ),				
));	

$this->render('index',array('sql_provider'=>$sql_provider));

看了类似的帖子 http://www.yiichina.com/topic/1911

但还是不太明白,分页那里怎么实现这样的样式呢?

您需要登录后才可以回复。登录 | 立即注册