会员后台显示等级价格

2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家

1、修改admin/includes/lib_goods.php的goods_list()函数部分
  1. return array('goods' => $row, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
复制代码

前面增加
  1. foreach($row as $key_tmp=>$goods_tmp)
  2. {
  3. $sql = "SELECT rank_id, IFNULL(mp.user_price, r.discount * $goods_tmp[shop_price] / 100) AS price, r.rank_name, r.discount " .
  4. 'FROM ' . $GLOBALS['ecs']->table('user_rank') . ' AS r ' .
  5. 'LEFT JOIN ' . $GLOBALS['ecs']->table('member_price') . " AS mp ".
  6. "ON mp.goods_id = '$goods_tmp[goods_id]' AND mp.user_rank = r.rank_id " .
  7. "WHERE r.show_price = 1 OR r.rank_id = '$_SESSION[user_rank]'";
  8. $res_up = $GLOBALS['db']->query($sql);
  9. while ($row_up = $GLOBALS['db']->fetchRow($res_up))
  10. {
  11. $row[$key_tmp]['user_price'][$row_up['rank_id']] = array(
  12. 'rank_name' => htmlspecialchars($row_up['rank_name']),
  13. 'price' => price_format($row_up['price']));
  14. }
  15. }
复制代码



模板
修改模板文件 admin/templates/goods_list.htm
在{$goods.shop_price}与</span>之间增加下面代码


回答:
......

不错要支持一下!

好帖子了呢 不错的分享 支持