zoukankan      html  css  js  c++  java
  • 帝国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

  • 相关阅读:
    Eventbus的功能
    Linux下xz与tar的区别
    IntelliJ IDEA出现:This file is indented with tabs instead of 4 spaces的问题解决
    IntelliJ IDEA设置properties文件显示中文
    oh-my-zsh官方教程
    Vim出现:_arguments:450: _vim_files: function definition file not found的问题解决
    Ubuntu 16.04下安装zsh和oh-my-zsh
    zsh与oh-my-zsh是什么
    Mac安装IntelliJ IDEA时快捷键冲突设置
    IntelliJ IDEA删除项目
  • 原文地址:https://www.cnblogs.com/surplus/p/12805662.html
Copyright © 2011-2022 走看看