帝国CMS自定义列表的排序

统计记录: select count(*) as total from [!db.pre!]ecms_movie

查询记录: select * from [!db.pre!]ecms_movie order by id desc

注释:[!db.pre!]ecms_movie 为数据表类型(movie是电影数据表)

desc - 降序排列 ASC - 升序排列

id desc 是按id降序排列 id ASC 是按id升序排列

举一反三排序方式:id(id)、newstime (时间)、onclick(点击或浏览)、p统计记录: select count(*) as total from [!db.pre!]ecms_movie

查询记录: select * from [!db.pre!]ecms_movie order by id desc

注释:[!db.pre!]ecms_movie 为数据表类型(movie是电影数据表)

desc - 降序排列 ASC - 升序排列

id desc 是按id降序排列 id ASC 是按id升序排列

举一反三排序方式:id(id)、newstime (时间)、onclick(点击或浏览)、plnum (评论)、diggtop 、rand (随机)

如:增加当前栏目(一般是错误的,因自定义列表不能用当前栏目这个参数,这是只是一个引用以备其他地方应用)
where classid='$GLOBALS[navclassid]'当前栏目

统计记录: select count(*) as total from [!db.pre!]ecms_movie where classid='$GLOBALS[navclassid]'

查询记录: select * from [!db.pre!]ecms_movie where classid='$GLOBALS[navclassid]' order by id desc

---------------------------------------------------------------------------

自定义列表调用多个栏目,或指定栏目(sql中指定的栏目ID必须为终极栏目ID)

统计记录: select count(*) as total from [!db.pre!]ecms_movie where classid in (23,24,25)

查询记录: select * from [!db.pre!]ecms_movie where classid in (23,24,25) order by id desc

lnum (评论)、diggtop 、rand (随机)

如:增加当前栏目(一般是错误的,因自定义列表不能用当前栏目这个参数,这是只是一个引用以备其他地方应用)
where classid='$GLOBALS[navclassid]'当前栏目

统计记录: select count(*) as total from [!db.pre!]ecms_movie where classid='$GLOBALS[navclassid]'

查询记录: select * from [!db.pre!]ecms_movie where classid='$GLOBALS[navclassid]' order by id desc

---------------------------------------------------------------------------

自定义列表调用多个栏目,或指定栏目(sql中指定的栏目ID必须为终极栏目ID)

统计记录: select count(*) as total from [!db.pre!]ecms_movie where classid in (23,24,25)

查询记录: select * from [!db.pre!]ecms_movie where classid in (23,24,25) order by id desc

posted on   剩余价值  阅读(1452)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示