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:

  1. calculate results of 2 fields directly in query , sort on that.
  2. use carraydataprovider , fill data associative array of query result (get result using dao) added 2 fields "manually".

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -