云优CMS如何按orderby排序上一条下一条信息

发布日期:2024-9-21 作者:云优CMS 人气:6680

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];


相关新闻

返回顶部

拨打电话
在线咨询
扫码添加微信咨询产品相关问题

全国统一服务电话: 0511-85995956