详情页最新商品
<!--相关商品-->
<div class="zws_modbox">
<div class="zs-modbox-hd">相关商品</div>
<ul class="zs-product-list clearfix">
{foreach:items=Api::run('getGoodsListBySelleridListnew',array('#seller_id#',$seller_id),6)}
<li>
<a href="{url:/site/products/id/$item[id]}" target="_blank">
<span class="zs-pic"><img src="{url:/pic/thumb/img/$item[img]/w/150/h/100}" alt="{$item['name']}"></span>
<span class="zs-title">{$item['name']}</span>
</a>
<div class="zs-price">¥<span>{$item['sell_price']}</span></div>
</li>
{/foreach}
</ul>
</div>
<!--相关商品-->
上面其中getGoodsListBySelleridListnew 这个api要在api_resource.php中定义,里面这样
//根据商家取商品列表
'getGoodsListBySelleridList'=>array(
'query'=>array(
'name' => 'goods',
'fields' => 'id,img,name,sell_price',
'where' => "seller_id = #seller_id# AND is_del = 0",
'order' => 'sort asc',
'limit' => 10,
)
),
//根据商家取最新商品列表
'getGoodsListBySelleridListnew'=>array(
'query'=>array(
'name' => 'goods',
'fields' => 'id,img,name,sell_price',
'where' => "seller_id = #seller_id# AND is_del = 0",
'order' => 'sort desc', //这里是排序,asc是升序,desc是降序所以是最新。
'limit' => 6,
)
),
<!--相关商品-->
<div class="zws_modbox">
<div class="zs-modbox-hd">相关商品</div>
<ul class="zs-product-list clearfix">
{foreach:items=Api::run('getGoodsListBySelleridListnew',array('#seller_id#',$seller_id),6)}
<li>
<a href="{url:/site/products/id/$item[id]}" target="_blank">
<span class="zs-pic"><img src="{url:/pic/thumb/img/$item[img]/w/150/h/100}" alt="{$item['name']}"></span>
<span class="zs-title">{$item['name']}</span>
</a>
<div class="zs-price">¥<span>{$item['sell_price']}</span></div>
</li>
{/foreach}
</ul>
</div>
<!--相关商品-->
上面其中getGoodsListBySelleridListnew 这个api要在api_resource.php中定义,里面这样
//根据商家取商品列表
'getGoodsListBySelleridList'=>array(
'query'=>array(
'name' => 'goods',
'fields' => 'id,img,name,sell_price',
'where' => "seller_id = #seller_id# AND is_del = 0",
'order' => 'sort asc',
'limit' => 10,
)
),
//根据商家取最新商品列表
'getGoodsListBySelleridListnew'=>array(
'query'=>array(
'name' => 'goods',
'fields' => 'id,img,name,sell_price',
'where' => "seller_id = #seller_id# AND is_del = 0",
'order' => 'sort desc', //这里是排序,asc是升序,desc是降序所以是最新。
'limit' => 6,
)
),