首页显示会员等级价格
投稿人:king
打开includes/lib_goods.php
搜索
$goods[$idx]['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']);
$sql = "SELECT rank_id, IFNULL(mp.user_price, r.discount * $row[shop_price] / 100) AS price, r.rank_name, r.discount " .
'FROM ' . $GLOBALS['ecs']->table('user_rank') . ' AS r ' .
'LEFT JOIN ' . $GLOBALS['ecs']->table('member_price') . " AS mp ".
"ON mp.goods_id = '$row[goods_id]' AND mp.user_rank = r.rank_id " .
"WHERE r.show_price = 1 OR r.rank_id = '$_SESSION[user_rank]'";
$res_up = $GLOBALS['db']->query($sql);
while ($row_up = $GLOBALS['db']->fetchRow($res_up))
{
$goods[$idx]['user_price'][$row_up['rank_id']] = array(
'rank_name' => htmlspecialchars($row_up['rank_name']),
'price' => price_format($row_up['price']));
}
依次打开 library/recommend_hot.lbi , library/recommend_best.lbi , library/recommend_new.lbi , library/recommend_promotion.lbi 文件
在
[table]
[td][tr][td][/td][td][/td][td]
[/td][/tr]
[/table]
market_price 或 shop_price 或 promote_price
后面增加 <p style="background:#eee;">
{if $goods.user_price}
{foreach from=$goods.user_price item=user_price }
<br>
{$user_price.rank_name}:{$user_price.price}
{/foreach}
{/if}
</p>
搜索
$goods[$idx]['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']);
$sql = "SELECT rank_id, IFNULL(mp.user_price, r.discount * $row[shop_price] / 100) AS price, r.rank_name, r.discount " .
'FROM ' . $GLOBALS['ecs']->table('user_rank') . ' AS r ' .
'LEFT JOIN ' . $GLOBALS['ecs']->table('member_price') . " AS mp ".
"ON mp.goods_id = '$row[goods_id]' AND mp.user_rank = r.rank_id " .
"WHERE r.show_price = 1 OR r.rank_id = '$_SESSION[user_rank]'";
$res_up = $GLOBALS['db']->query($sql);
while ($row_up = $GLOBALS['db']->fetchRow($res_up))
{
$goods[$idx]['user_price'][$row_up['rank_id']] = array(
'rank_name' => htmlspecialchars($row_up['rank_name']),
'price' => price_format($row_up['price']));
}
依次打开 library/recommend_hot.lbi , library/recommend_best.lbi , library/recommend_new.lbi , library/recommend_promotion.lbi 文件
在
[table]
[td][tr][td][/td][td][/td][td]
[/td][/tr]
[/table]
market_price 或 shop_price 或 promote_price
后面增加 <p style="background:#eee;">
{if $goods.user_price}
{foreach from=$goods.user_price item=user_price }
<br>
{$user_price.rank_name}:{$user_price.price}
{/foreach}
{/if}
</p>