雲優CMS如何按orderby排序上一條下一條信息

發(fā)布日期:2018-10-10 作者:雲優CMS 人氣:6613

1、\app\index\controller\Show.php

搜索:

$prev = $conmodel->getContentPrev($category['id'], $content['id']);

$next = $conmodel->getContentNext($category['id'], $content['id']);

修改爲:

$prev = $conmodel->getContentPrev($category['id'], $content['id'], $content['sort']);

$next = $conmodel->getContentNext($category['id'], $content['id'], $content['sort']);


2、\app\index\model\ContentModel.php

搜索:

public function getContentNext($cid, $id){

        $where['id'] = ['GT', $id];

修改爲:

public function getContentNext($cid, $sort){

        $where['sort'] = ['GT', $sort];


搜索:

public function getContentPrev($cid, $id){

        $where['id'] = ['GT', $id];

修改爲:

public function getContentPrev($cid, $sort){

        $where['sort'] = ['LT', $sort];


相關新聞

返回頂部

撥打電話
在線咨詢
掃碼添加微信咨詢産品相關問題

全國(guó)統一服務電話: 0511-85995956