在搜索列表里无法调用出表格的内容,求解决办法。
{search module=MOD_DIR id=$searchid total=$sototal order=$params.order more=1 catid=$catid page=1 pagesize=5 urlrule=$urlrule return=rs}
<?php if ($t['hycd']) { foreach ($t['hycd'] as $v) { ?>
<dl>
<dd>{$v[2]}</dd>
<dd class="redc">¥{$v[3]}</dd>
</dl>
<?php } } ?>
<?php if ($rs['hycd']) { foreach ($rs['hycd'] as $v) { ?> <dl> <dd>{$v[2]}</dd> <dd class="redc">¥{$v[3]}</dd> </dl> <?php } } ?>如果还是不出来就使用下诊断变量搜索页面的模板标签生成工具:https://www.xunruicms.com/doc/code/search.html
{$debug_rs}迅睿框架联合创始人<p>标签解析:{list action=search module=MOD_DIR id=4c56f3ac4681fb43965ded81cd1879ec total=1 order= more=1 catid=1 page=1 pagesize=5 urlrule=http://hun.0il.cn/index.php?s=news&c=search&diqu=baiyunqu&catid=1&page=%7Bpage%7D return=rs}</p><p>搜索解析:SELECT `dr_1_news`.`id` FROM `dr_1_news` WHERE `dr_1_news`.`status` = 9 AND `dr_1_news`.`catid`=1 AND `dr_1_news`.`id` IN (SELECT `id` FROM `dr_1_news_category_data` WHERE (`dr_1_news_category_data`.`diqu`=2)) ORDER BY NULL </p><p>查询解析: SELECT `dr_1_news`.*,`dr_1_news_category_data`.`diqu`,`dr_1_news_category_data`.`jdlx`,`dr_1_news_category_data`.`hqcd`,`dr_1_news_category_data`.`rnzs`,`dr_1_news_category_data`.`jiagezhuo`,`dr_1_news_category_data`.`dianhua`,`dr_1_news_category_data`.`dizhi_lng`,`dr_1_news_category_data`.`dizhi_lat`,`dr_1_news_category_data`.`dizhi`,`dr_1_news_category_data`.`shipindizhi`,`dr_1_news_category_data`.`hycd`,`dr_1_news_category_data`.`shipindizhi2`,`dr_1_news_category_data`.`sp1slt`,`dr_1_news_category_data`.`sp2slt`,`dr_1_news_category_data`.`fmdt`,`dr_1_news_category_data`.`jdjs` FROM `dr_1_news` LEFT JOIN dr_1_news_category_data ON `dr_1_news_category_data`.`id`=`dr_1_news`.`id` WHERE `dr_1_news`.`status` = 9 AND `dr_1_news`.`catid`=1 AND `dr_1_news`.`id` IN (SELECT `id` FROM `dr_1_news_category_data` WHERE (`dr_1_news_category_data`.`diqu`=2)) ORDER BY `dr_1_news`.`updatetime` DESC LIMIT 0,5</p><p>当前地址:http://hun.0il.cn/index.php?s=news&c=search&diqu=baiyunqu&catid=1</p><p>当前路由:news/search/index</p><p>变量前缀:rs</p><p>开发模式:已开启</p><p>数据缓存:后台未开启缓存</p><p>总记录数:1</p><p>分页功能:已开启</p><p>当前页码:1</p><p>总页数量:1(数据量未达到分页数据,因此只有一页)</p><p>每页数量:5</p><p>分页地址:http://hun.0il.cn/index.php?s=news&c=search&diqu=baiyunqu&catid=1&page={page}</p><p>可用字段:id、catid、title、thumb、keywords、description、hits、uid、author、status、url、link_id、tableid、inputip、inputtime、updatetime、displayorder、diqu、jdlx、hqcd、rnzs、jiagezhuo、dianhua、dizhi_lng、dizhi_lat、dizhi、shipindizhi、hycd、shipindizhi2、sp1slt、sp2slt、fmdt、jdjs、_inputtime、_updatetime</p>迅睿框架联合创始人<?php $rs['hycd']=dr_string2array($rs['hycd']); if ($rs['hycd']) { foreach ($rs['hycd'] as $v) { ?> <dl> <dd>{$v[2]}</dd> <dd class="redc">¥{$v[3]}</dd> </dl> <?php } } ?>debug很重要,一眼就可以找出问题的所在