聯(lián)系官方銷售客服
1835022288
028-61286886
上一篇下一篇,按照“錄入日期”進(jìn)行排序。
問題描述:
1、列表頁的排序是按照“錄入時(shí)間”排序的
{module catid=$catid order=inputtime page=1}
2、但是詳情頁卻是按照“ID”排序的
3、看了N多帖子,用帖子內(nèi)的方法,進(jìn)行了修改,但是發(fā)現(xiàn)并不生效,修改后,如下:
路徑:
Module.php
// 上一篇文章 $builder = \Phpcmf\Service::M()->db->table($this->content_model->mytable); $builder->where('catid', (int)$data['catid'])->where('status', 9); $is_fstatus && $builder->where('fstatus', 1); $builder->where('inputtime<', (int)$data['inputtime'])->orderBy('inputtime desc'); $data['prev_page'] = $builder->limit(1)->get()->getRowArray(); // 下一篇文章 $builder = \Phpcmf\Service::M()->db->table($this->content_model->mytable); $builder->where('catid', (int)$data['catid'])->where('status', 9); $is_fstatus && $builder->where('fstatus', 1); $builder->where('inputtime>', (int)$data['inputtime'])->orderBy('inputtime asc'); $data['next_page'] = $builder->limit(1)->get()->getRowArray();
本人非專業(yè)開發(fā)人員,求詳細(xì)的解答,非常感謝。
官方提醒:使用module內(nèi)容循環(huán)標(biāo)簽的生成工具,填寫參數(shù)就可以生成相關(guān)的代碼,每個(gè)參數(shù)后面都有用法解釋
Module.php是系統(tǒng)文件,頭部已經(jīng)注釋了,不能修改他
回復(fù)@迅??蚣芗夹g(shù)-劉和平 您好,那需要去哪里修改那?
重寫content類 ,需要有開發(fā)基礎(chǔ)
參考文檔:《重寫內(nèi)容Content類》
我做過這種功能,重寫content類才行,系統(tǒng)文件改不得
http://223987.com/wenda/10448.html
參考這個(gè)
回復(fù)@稻草人
大俠,按您的方法已經(jīng)成功,但是關(guān)于排序方式,還是不太清楚,是否可以麻煩幫看下:
頁面show的調(diào)用:
問題描述:現(xiàn)在排序確實(shí)有變化,應(yīng)該是已經(jīng)可以作用到該區(qū)域,但是按照“錄入時(shí)間”排序,還是未實(shí)現(xiàn)。