分类分类
更新时间:2026-10-06 17:18:19作者:fang
如何在在ECSHOP后台的商品列表中也显示商品的品牌”。
下面就来最模板讲一下如何来修改。此方法只保证在ECSHOP2.7.2版本下有效,其他版本请参照修改。
第一步:
首先我们来打开程序文件: /admin/includes/lib_goods.php
定位到 goods_list 函数部分
找到下面代码(大概在911行左右)
$sql = "SELECT goods_id, goods_name, goods_type, goods_sn, shop_price, is_on_sale, is_best, is_new, is_hot, sort_order, goods_number, integral, " .
" (promote_price > 0 AND promote_start_date <= '$today' AND promote_end_date >= '$today') AS is_promote ".
" FROM " . $GLOBALS['ecs']->table('goods') . " AS g WHERE is_delete='$is_delete' $where" .
" ORDER BY $filter[sort_by] $filter[sort_order] ".
" LIMIT " . $filter['start'] . ",$filter[page_size]";
将它修改为
$sql = "SELECT goods_id, goods_name, goods_type, goods_sn, shop_price, is_on_sale, is_best, is_new, is_hot, sort_order, goods_number, integral, " .
" (promote_price > 0 AND promote_start_date <= '$today' AND promote_end_date >= '$today') ".
“As is_promote,b.brand_name FROM”.$GLOBAs['ecs']->table('goods')."AS g".
"left join".$GLOBAs['ecs']->table('goods')."AS b on g.brand_id=b.brand_id".
"where is_delete='$is_delete'$where".
" ORDER BY $filter[sort_by] $filter[sort_order] ".
" LIMIT " . $filter['start'] . ",$filter[page_size]";
第二步:
修改 admin/templates/goods_list.htm 文件
找到
{$goods.goods_name|escape:html}
在它后面增加一行代码:
(品牌:{$goods.brand_name})
修改到这里,你会发现品牌是能显示出来了,但是搜索功能里的按品牌搜索却失效了。别着急,第三步就是来解决这个问题的。
第三步(很重要):
向上,找到下面代码(大概在865行左右)
$where .= " AND brand_id='$filter[brand_id]'";
将它修改为
$where .= " AND g.brand_id='$filter[brand_id]'";
相关
摄像头远程监控看家2026官方最新版本生活服务36.4 MBv1.0.02026-10-06
下载公务员省考最新手机版学习办公57.5 MBv6.09.112026-10-06
下载野性蜂巢(Wild Hive)经营养成267.49 Mv1.66.42026-10-04
下载趣好卖app网上购物74.76 Mv5.2.52026-10-04
下载兔叽月记app医疗健康55.33 Mv1.5.22026-10-04
下载魔力弹神策略游戏33.56 Mv1.0.02026-10-04
下载大破坏幸存者策略游戏62.28 Mv1.0.32026-10-04
下载啃豆小仓拼豆app实用工具41.74 Mv1.32026-10-04
下载方块公国安卓移植版策略游戏1.58Gv1.2.202026-10-04
下载快车顺风车出行2026官方最新版本生活服务82.0 MBv1.1.22026-10-04
下载网约上门按摩2026官方最新版本生活服务73.9 MBv2.0.22026-10-04
下载道运考试通(道路考练工具)学习办公32.8 MBv6.0.12026-10-04
下载










