1

How to fix pagination order by problem in cakephp. My code is here..

$testarray = array(010,011,012,013,014,015,001,002,003,004,005,006,007,008,009);

$this->paginate = array(
    'conditions' => $testarray,
    'fields' => array('Test.id'),
    'limit' => 10,
    'page' => 1
);

$testpaginate = $this->paginate('Test');

I want the output to be like $testarray, but I get the following:

array(001,002,003,004,005,006,007,008,009,010)  

How can I achieve my desired result?

4

1 に答える 1

0

これを試してみてください:

$this->paginate = array(
  'conditions' => $testarray,
  'fields' => array('Test.id'),
  'limit' => 10,
  'page' => 1,
  'order' => '',
);

おそらく、CakePHP の組み込みメソッド以外のオプションに頼らなければならないでしょう。

于 2013-01-04T00:25:10.393 に答える