调用基本数据包含数据
{eyou:php} $sql = "SELECT * FROM ey_archives WHERE title LIKE '%111%' and channel = 101 and is_recom=1 limit 10"; $sql = 'select * from ey_archives where channel = 101 and is_recom=1 limit 10'; $tmp_list = db()->query($sql); foreach ($tmp_list as $_k => $_v) { echo "栏目ID:".$_v['aid']; echo " -- "; echo "文章标题:".$_v['title']; echo " -- "; echo "文章/index.php?m=home&c=View&a=index&aid=".$_v['aid']; echo "<br/>"; } {/eyou:php}
调用自定义数据
{eyou:php} $sql = "SELECT a.title,a.aid,b.tuanjianleixing FROM ey_archives as a,ey_fangan_content as b where a.aid=b.aid and is_recom=1 order by id desc limit 6"; $tmp_list = db()->query($sql); foreach ($tmp_list as $_k => $_v) { echo "栏目ID:".$_v['tuanjianleixing']; echo " -- "; echo "文章标题:".$_v['title']; echo " -- "; echo "文章/index.php?m=home&c=View&a=index&aid=".$_v['aid']; echo "<br/>"; } {/eyou:php}
转载请注明:eyoucms» eyoucms筛选里面调用其他频道数据自定义数据
标签: