织梦开发商城时用到loop标签和sql标签循环出产品列表页内容,产品详情内容需跨多个表获取信息,分别用loop和sql给大家举个例子
  • loop标签查询
{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}
  • sql标签查询
{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}