bootsrap[$data]
<?php $this->widget('bootstrap.widgets.TbGridView', array(
'type'=>'Default',
'dataProvider'=>$gridDataProvider,
'template'=>"{items}",
// 'htmlOptions'=> array('style'=>'border-top:0'),
'columns'=>array(
//array('name'=>'id', 'header'=>'#'),
array('name'=>'ad_cnt', 'header'=>'广告总数'),
array('name'=>'ad_checking_cnt', 'header'=>'等待审核的广告总数'),
array('name'=>'ad_checkend_cnt', 'header'=>'运行中广告总数'),
array('name'=>'ad_stop_cnt', 'header'=>'已停止的广告总数'),
array('name'=>'ad_pause_cnt', 'header'=>'已暂停的广告总数'),
array('name'=>'ad_deny_cnt', 'header'=>'审核未通过的广告总数'),
array('name'=>'ad_excess_budget', 'header'=>'超出预算的广告数','htmlOptions'=>array('onmouseover'=>'showDialog()')),
),
)); ?>
在bootstrap 中,如果'dataProvider'=>$gridDataProvider ,其下的$data就是$gridDataProvider
admange/views/checksad/admin.php/
array(
'name' => 'uid',
'header' => '所属广告主',
'value' => 'Publish::getUserList($data->uid)',
'type'=>'raw',
'htmlOptions'=>array('style'=>'width:100px'),
'filter' => Publish::getUserList(),
),
<?php $this->widget('bootstrap.widgets.TbGridView',array(
'id'=>'publish-grid',
'type'=>'striped bordered condensed hover',
'dataProvider'=>$model->search(),
'filter'=>$model,
//'htmlOptions'=> array('style'=>'border:0;'),
'columns'=>array(
/*array(
'name' => 'id',
'type'=>'raw',
//'htmlOptions'=>array('style'=>'width:40px;')
),*/
array(
'name' => 'ad_name',
'type'=>'raw',
'htmlOptions'=>array('style'=>'width:150px')
),
array(
//'name' => 'ad_day_budget',
'header' => '每日预算',
'type'=>'raw',
'value'=>'"¥".$data->ad_day_budget'
//'htmlOptions'=>array('style'=>'width:80px')
),
array(
'name' => 'adRunningTime',
'value'=>'$data->getAdRunningTime()',
'type'=>'raw',
'header' =>'投放时间',
'htmlOptions'=>array('style'=>'width:170px'),
'filter' => false
),
array(
'header' => '付费方式',
//'name' => 'ad_pay_mode',
'type'=>'raw',
'value'=>'$data->getPayMode($data->ad_pay_mode)',
//'htmlOptions'=>array('style'=>'width:80px')
),
/*array(
'name' => 'ad_price',
'type'=>'raw',
//'htmlOptions'=>array('style'=>'width:80px')
),*/
array(
'name' => 'space_id',
//'header' => '所属广告位',
'value' => 'Publish::getSpaceList($data->space_id)',
'type'=>'raw',
'htmlOptions'=>array('style'=>'width:100px'),
'filter' => Publish::getSpaceList(),
),
array(
'name' => 'uid',
'header' => '所属广告主',
'value' => 'Publish::getUserList($data->uid)',
'type'=>'raw',
'htmlOptions'=>array('style'=>'width:100px'),
'filter' => Publish::getUserList(),
),
array(
'name' => 'adStatus',
'type'=>'raw',
'header'=>'广告状态',
//'htmlOptions'=>array('style'=>'width:50px'),
'filter' => false
),
array(
'class'=>'bootstrap.widgets.TbButtonColumn',
'header'=>'操作'
),
array(
'header'=>'审核',
'visible'=> $is_supperUser ? TRUE : FALSE,
'type'=>'raw',
'value'=>'$data->getCheckBtns()',
'htmlOptions'=>array('style'=>'width:50px')
),
),
)); ?>
admange/controll/ChecksAdController.php
Manages[管理] all models.
//p(196)
public function actionAdmin()
{
$model=new Publish('search');
$model->unsetAttributes(); // clear any default values
}
admange/models/Publish.php