Model query with paging does not work - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Model query with paging does not work (/showthread.php?tid=80127) |
Model query with paging does not work - Thiaxl - 09-16-2021 When I use pagination and in the query there is an 'orderBy()', codeigniter returns an error: Duplicate column name 'created_at'. Does anyone know how to resolve this situation? My code: Code: $transacao = $this->transacao_model Ps. Sorry for my english. RE: Model query with paging does not work - wdeda - 09-16-2021 My apologies, for greater understanding I will use our native language, mine and #thiaxi's, Portuguese. Vamos lá. Acredito que as coisas estão invertidas, para não complicar muito, abaixo, um controller meu, bem similar ao seu. Penso que lhe dará, espero, a montagem correta: PHP Code: $model = new AlbumModel(); RE: Model query with paging does not work - Thiaxl - 09-17-2021 (09-16-2021, 05:50 PM)wdeda Wrote: My apologies, for greater understanding I will use our native language, mine and #thiaxi's, Portuguese. Good Morning. Thanks for the answer. I tried to use your answer to fix the error but it didn't work. Paging does not work with GroupBy. If I remove GroupBy, the code works. I'm uploading some images of the error. |