loop中的sql参数详解

来源:官方· 作者 jizhicms· 28次点击 · 6个月前

定义

where条件的sql代码

示例

查询当天发布的内容

{php

$start = strtotime(date('Y-m-d 00:00:00'));
$end = strtotime(date('Y-m-d 23:59:59'));
$sql = "addtime>=".$start." and addtime<=".$end;

/}

{loop table="article" sql="$sql" limit="10" as="v"}

{/loop}

注意事项

$sql必须是在PHP中写内容,不能直接在loop中写。

被收藏 0  ∙  0 赞  
加入收藏
0 回复  
善言善语 (您需要 登录 后才能回复 没有账号 ?)

请先登录网站