聯(lián)系官方銷售客服
1835022288
028-61286886
插件名稱 | API接口 V7.8 |
插件作者 | 迅睿官方團隊 |
最近更新 | 2025-03-06 07:21:54 |
支持對達夢數(shù)據(jù)庫的驅(qū)動 |
內(nèi)容頁關(guān)聯(lián)文章標(biāo)簽related接口調(diào)用不顯示?
{if $tag} {related module=news field=title,inputtime,support,hits,thumb,catid,uid tag=$tag page=1 pagesize=10 urlrule=$urlrule return=r} {php $api['thumb'] = dr_thumb($c, 260, 195, 0, 'crop');} {php $api['support'] = intval($r['support']);} {php $api['title'] = $r['title'];} {php $api['hits'] = intval($r['hits']);} {php $api['comments'] = dr_cat_value('works', $r['catid'], 'name');} {php $api['inputtime'] = dr_fdate($r['_inputtime']);} {/related} {/if}
回復(fù)@官方插件技術(shù)-胡老師 辛苦了,這么晚還沒休息 ??
這是內(nèi)容頁,沒有[$key],研究了半天,
現(xiàn)在調(diào)用出來后沒有循環(huán),求教
回復(fù)@likeren
回復(fù)@官方插件技術(shù)-胡老師

回復(fù)@GoWorkRoom
是這個嗎?
{php $api['tag'] = $tag;}
{php $api['relatedlist'] = [];}
{related module=works field=title,support,thumb,upworks,uid tag=$tag page=1 pagesize=10 return=r}
{php $api['relatedlist'][$key]['id'] = $r['id'];}
{php $api['relatedlist'][$key]['author'] = dr_member_info($r['uid'])['name'];}
{php $api['relatedlist'][$key]['thumb'] = dr_thumb($r['thumb'], 260, 195, 0, 'crop');}
{php $api['relatedlist'][$key]['title'] = $r['title'];}
{php $api['relatedlist'][$key]['updatetime'] = dr_date($r['updatetime']);}
{php $api['relatedlist'][$key]['description'] = dr_strcut($r['description'], 100, '...');}
{php $api['relatedlist'][$key]['user_avatar'] = dr_avatar($r['uid']);}
{php $api['relatedlist'][$key]['support'] = intval($r['support']);}
{php $api['relatedlist'][$key]['comments'] = $r['comments'];}
{/related}
{php $api['relatedlist']['total'] = $total;}
{php $api['relatedlist']['nums'] = $nums;}
{php $api['relatedlist']['page'] = $page;}
{php $api['relatedlist']['pagesize'] = $pagesize;}
注意 retuen=r
下面 $key 要對應(yīng)寫成 $key_r