PHP
1 $this->paginate = [ 2 'contain' => ['User'], 3 'conditions' => ['Posts.status >' => 0], 4 'order' => ['Posts.priority ASC', 'Posts.cretated ASC'], 5 'limit' => '100' 6 ]; 7$posts = $this->paginate($this->Posts);
CakePHP3系でpaginateの際に、orderを複数指定すると、
Templateの1ページ目は問題なく表示されるのですが、2ページをクリックするとエラーになってしまいます。
エラー内容は下記です。
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc LIMIT 20 OFFSET 20' at line 1
Paginatorの2ページ目をクリックした際のクエリーは下記です。
?page=2&sort=0&direction=Posts.priority+ASC
前は出来ていたような気がするのですが、、、
ご存知のかた教えていただきたいです。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/09/09 14:05