dede織夢(mèng)
前段時(shí)間用織夢(mèng)開發(fā)商城時(shí)用到loop和sql標(biāo)循環(huán)出產(chǎn)品列表頁內(nèi)容,因?yàn)楫a(chǎn)品詳情內(nèi)容需要跨越多個(gè)表獲取信息,所以對(duì)dede織夢(mèng)的loop和sql標(biāo)簽進(jìn)行研究,發(fā)現(xiàn)兩個(gè)標(biāo)簽都能夠進(jìn)行多表查詢,以下是例子:
{dede:loop table='dede_category_brand b,dede_goods g,dede_category_series s' row='8' if='b.cat_id=g.cat_brand_id and g.cat_series_id=s.series_name and g.cat_id=72'}
[field:cat_name/]
[field:series_name/]
[field:goods_model/]
[field:shop_price/]
{/dede:loop}
{dede:sql sql='select * from dede_category_brand b,dede_goods g,dede_category_series s where b.cat_id=g.cat_brand_id and g.cat_series_id=s.series_name and g.cat_id=71 limit 0,8'}
[field:cat_name/]
[field:series_name/]
[field:goods_model/]
[field:shop_price/]
{/dede:sql}