php - CSqlDataProvider yii sorting after manipulating data -
i showing data csqldataprovider pagination, want add sorting results
situation is-
data
$dataprovider=new csqldataprovider($sqlall, array( 'totalitemcount'=>$count, 'pagination'=>array('pagesize'=>$pagesize,), 'params' => $params ));after results calculate 2 more fields show(which not extracted $sqlall query) , sort according them
problem is: $pagesize amount of results, , happens sorting per $pagesize results , not results.
can add calculated fields csqldataprovider or pagination?
you add calculated fields in 1 of 2 ways:
- calculate results of 2 fields directly in query , sort on that.
- use carraydataprovider , fill data associative array of query result (get result using dao) added 2 fields "manually".
Comments
Post a Comment