2.7.0后台订单详情购物人信息BUG

2016-07-07 15:32 来源:www.chinab4c.com 作者:ecshop专家



后台订单详情查看页面
order.php?act=info&
显示购货人信息
  1. if ($user['user_rank'] > 0)
  2. {
  3. $where = " WHERE rank_id = '$user[user_rank]' ";
  4. }
  5. else
  6. {
  7. $where = " WHERE min_points <= " . intval($user['rank_points']) . " ORDER BY min_points DESC ";
  8. }
  9. $sql = "SELECT rank_name FROM " . $ecs->table('user_rank') . $where;
  10. $user['rank_name'] = $db->getOne($sql);
复制代码


当数据库内会员等级均为特殊等级时而此购货人没有指定会员特殊等级,则读取一个不符合要求的会员等级

应修改为:
  1. /* 用户等级 */
  2. if ($user['user_rank'] > 0)
  3. {
  4. $where = " WHERE rank_id = '$user[user_rank]' ";

  5. }
  6. else
  7. {
  8. $where = " WHERE special_rank = 0 AND min_points <= " . intval($user['rank_points']) . " ORDER BY min_points DESC ";
  9. }
  10. $sql = "SELECT rank_name FROM " . $ecs->table('user_rank') . $where;
  11. if ($tmp_usr = $db->getOne($sql))
  12. {
  13. $user['rank_name'] = $tmp_usr;
  14. }
  15. else
  16. {
  17. $user['rank_name'] = '';
  18. }
复制代码