- 在ECSHOP后台商品列表中显示品牌的方法
发布时间:2010-06-06 类别:PHP技术 来源:侠客工作室 -
- 1
- 2
- 3
- 4
- 5
在后台商品列表中显示品牌的方法
1、修改admin/includes/lib_goods.php
找到goods_list()函数部分
将
$sql = "SELECT goods_id, goods_name, 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_sn, shop_price, is_on_sale, is_best, is_new, is_hot, g.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 " . $GLOBALS[‘ecs‘]->table(‘goods‘) . " AS g left join " .$GLOBALS[‘ecs‘]->table(‘brand‘). " 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]";
复制代码
2、修改 admin/templates/goods_list.htm
在
<th><a href="javascript:listTable.sort(‘goods_sn‘); ">{$lang.goods_sn}</a>{$sort_goods_sn}</th>
复制代码
下增加
<th>品牌</th>
在
<td><span onclick="listTable.edit(this, ‘edit_goods_sn‘, {$goods.goods_id})">{$goods.goods_sn}</span></td>
复制代码
下增加
<td><span>{$goods.brand_name}</span></td>- ☆☆☆技术交流群:5684178☆☆☆
- 上一篇:ecshop生成静态页方法
- 下一篇:如何实现ecshop后台管理商品的评论和咨询以及文章评论