我有for n in myGraph.nodes():
print n, networkx.shortest_path(graph, 1, n)
,其中有8个项目。但是计数显示grid view
控制器代码
Showing 1-8 of 10 items.
查看代码
public function actionViewsetpdf($id)
{
$model = $this->findModel($id);
$session = Yii::$app->session;
$sqla = $session->get('result');
$session = Yii::$app->session;
$cnt = $session->get('count');
$dataProvider = new SqlDataProvider([
'sql' => $sqla,
'totalCount'=>$cnt,
'pagination' => [
'pageSize' => 20,
],
]);
return $this->render('viewsetpdf', [
'dataProvider' => $dataProvider,
'model' => $this->findModel($id),
'id' => $model->id
/*'searchModel' => $searchModel*/
]);
}
我已经检查了我的 <?= GridView::widget([
'dataProvider' => $dataProvider,
/*'filterModel' => $searchModel,*/
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'label'=>'OGP Serial #',
'value' => 'OGP_Serial_No'
],
'Date',
'Created_By',
'Meter_Serial_Number',
'Issued_To',
'Store',
'Admin_Incharge',
'Project_Manager',
'Driver_Name',
],
]); ?>
查询和count
查询,两者都返回了正确的计数和结果,即8项。我不知道为什么摘要没有正确显示。
任何帮助都将受到高度赞赏。