一般筛选列表会带有排序功能,比如按价格排序,按点击量排序等;
支持按正充,倒序;
{order field="newstime" name="时间" ascName="按时间正序" descName="按时间倒序" checkStyle="on" ascStyle="onUp" descStyle="onDown"}
输出的HTML代码
<a href="?order=newstime&ordertype=desc" class="">时间</a>
字段 | 类型 | 必填 | 默认 | 说明 |
field | String | No | - | 要排序的字段,如果为空则删除url中的排序条件 |
name | String | No | - | 显示的内容 |
ascName | String | No | - | 当为正序的时候显示内容 |
descName | String | No | - | 当为倒序的时候显示内容 |
checkStyle | String | No | on | 选中的时候class类名 |
ascStyle | String | No | onUp | 当为正序的时候class类名 |
descStyle | String | No | onDown | 当为倒序的时候class类名 |
要排序的字段,需要在模型里勾选上要排序的字段,但是下系统字段可以直接调用:
sort:信息排序
is_good:推荐
is_top:置顶
views:点击数
goods:点赞数
favs:收藏数
comments:评价数
//标签代码
默认: {order name="默认" checkStyle="none"}
按时间排序:{order field="newstime" name="时间" ascName="按时间正序" descName="按时间倒序" }
//输出的html代码
默认: <a href="?" class="">默认</a>
按时间排序:<a href="?order=newstime&ordertype=desc" class="">时间</a>