• ecshop属性排序


    属性的排序有三个方式:sort_order, attr_price, goods_attr_id
    如果要修改的话,修改 includes/lib_goods.php文件的 get_goods_properties()函数。
    找到 ORDER BY a.sort_order, g.attr_price, g.goods_attr_id 这里,改为:
    ORDER BY g.goods_attr_id 这样就是以你的输入顺序来显示了。

    情况一:添加新产品时,让属性按照添加的顺序(属性id)排列
    修改/inclues/lib_goods.php

        /* 获得商品的规格 */
        $sql = "SELECT a.attr_id, a.attr_name, a.attr_group, a.is_linked, a.attr_type, ".
                    "g.goods_attr_id, g.attr_value, g.attr_price " .
                'FROM ' . $GLOBALS['ecs']->table('goods_attr') . ' AS g ' .
                'LEFT JOIN ' . $GLOBALS['ecs']->table('attribute') . ' AS a ON a.attr_id = g.attr_id ' .
                "WHERE g.goods_id = '$goods_id' " .
                'ORDER BY g.goods_attr_id, a.sort_order, g.attr_price';
        $res = $GLOBALS['db']->getAll($sql);

  • 相关阅读:
    本周面试总结
    本周面试总结
    本周面试题总结
    网络请求AJAX
    es6数组、对象的解构赋值
    es6箭头函数
    es6总结
    js限定输入为数字包括负数正则
    js限定输入为非负数,浮点数正则
    js数值千分隔(正则)
  • 原文地址:https://www.cnblogs.com/sanwenyu/p/4045387.html
Copyright © 2020-2023  润新知