|
二开修改EctouchECSHOP后台的商品列表里显示商品品牌 最近帮客户二开Ectouch,需要强化下后台的商品列表,所以百度了一下二开教程,找了一些,但是自己有点领悟不了,因为教程没标注到细节,所以自己研究了一下,成功了,现在小编将自己的经历写一写 一样,根据教程里面的 第一步: 首先我们来打开程序文件: /admin/includes/lib_goods.php 定位到 goods_list 函数部分 找到下面代码(大概在911行左右)$sql="SELECTgoods_id,goods_name,goods_type,goods_sn,virtual_sales,shop_price,is_on_sale,is_best,is_new,is_hot,sort_order,goods_number,integral,"."(promote_price>0ANDpromote_start_date<='$today'ANDpromote_end_date>='$today')ASis_promote"."FROM".$GLOBALS['ecs']->table('goods')."ASgWHEREis_delete='$is_delete'$where"."ORDERBY$filter[sort_by]$filter[sort_order]"."LIMIT".$filter['start'].",$filter[page_size]";将它修改为$sql="SELECTgoods_id,goods_name,goods_type,goods_sn,shop_price,goods_thumb,is_on_sale,is_best,is_new,is_hot,g.sort_order,goods_number,integral,"."(promote_price>0ANDpromote_start_date<='$today'ANDpromote_end_date>='$today')"."Asis_promote,b.brand_nameFROM".$GLOBALS['ecs']->table('goods')."ASg"."LEFTJOIN".$GLOBALS['ecs']->table('brand')."ASbong.brand_id=b.brand_id"."WHEREis_delete='$is_delete'$where"."ORDERBY$filter[sort_by]$filter[sort_order]"."LIMIT".$filter['start'].",$filter[page_size]"; 这里要主要的就是 sort_order 需要改成g.sort_order 这个细节一点要注意到的 $sql="SELECTgoods_id,goods_name,goods_type,goods_sn,shop_price,goods_thumb,is_on_sale,is_best,is_new,is_hot, sort_order,goods_number,integral,". $sql="SELECTgoods_id,goods_name,goods_type,goods_sn,shop_price,goods_thumb,is_on_sale,is_best,is_new,is_hot,g.sort_order,goods_number,integral,". 第二步: 修改 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]'"; |
|