打印报价格,如何按货号进行排序

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

我在打印报价格页增加了产品图片和货号,但排序很乱。qutoation.php的查询语名中哪里修改排序的。

回答:
有知道的吗?在线等。不知道修改哪里是排序的。
  1. $sql = "SELECT g.goods_sn, g.goods_id, g.goods_thumb, g.goods_name,g.shop_price, g.goods_number, c.cat_name AS goods_category,p.product_sn,p.product_number,p.goods_attr".

  2. " FROM " . $ecs->table('goods') . " AS g LEFT JOIN " . $ecs->table('category') . " AS c ON g.cat_id = c.cat_id LEFT JOIN ".$ecs->table('products')."as pOn g.goods_id=p.goods_id" . $where . " AND is_on_sale = 1 AND is_alone_sale = 1 ";

  3. $goods_list = $db->getAll($sql);



  4. foreach($goods_list as $key=>$val)

  5. {

  6. if(!empty($val['product_id']))

  7. {
  8. $goods_list[$key]['goods_thumb']=$val['product_thumb'];
  9. $goods_list[$key]['goods_sn']=$val['product_sn'];
  10. $goods_list[$key]['goods_number']=$val['product_number'];

  11. $product_info=product_info($val['goods_attr'],$val['goods_id']);

  12. $goods_list[$key]['members_price']= $val['shop_price'];

  13. $goods_list[$key]['shop_price'] += $product_info['attr_price'];

  14. $goods_list[$key]['product_name']=$product_info['attr_value'];

  15. $goods_list[$key]['attr_price']=$product_info['attr_price'];

  16. }

  17. else

  18. {

  19. $goods_list[$key]['members_price']= $val['shop_price'];

  20. $goods_list[$key]['product_name']=' ';

  21. $goods_list[$key]['product_price']=0;

  22. }

  23. $goods_list[$key]['goods_key']=$key;

  24. }

  25. $user_rank = $db->getAll("SELECT * FROM " .$ecs->table('user_rank') . "WHERE show_price = 1 OR rank_id = '$_SESSION[user_rank]'");

  26. $rank_point = 0;

  27. if (!empty($_SESSION['user_id']))

  28. {

  29. $rank_point = $db->getOne("SELECT rank_points FROM " . $ecs->table('users') . " WHERE user_id = '$_SESSION[user_id]'");

  30. }

  31. $user_rank = calc_user_rank($user_rank, $rank_point);

  32. $user_men = serve_user($goods_list);

  33. $smarty->assign('extend_price', $user_rank['ext_price']);

  34. $smarty->assign('extend_rank', $user_men);

  35. $smarty->assign('goods_list', $goods_list);



  36. $html = $smarty->fetch('quotation_print.html');

  37. exit($html);

  38. }
复制代码

order by goods_sn

优品诚专业的电子商务二开供应商,解决您一切针对ecshop相关的需求,主机,模板,功能定制的问题,价格透明,质量保证。

具体可以联系我们的在线客服人员,QQ:2397358844544350711
也可通过邮件方式与我们取得联系upincheng@gmail.com
或者到我们的官网上进行留言www.upin99.com