博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ECSHOP 让你的商城显示“下架商品”列表
阅读量:6133 次
发布时间:2019-06-21

本文共 3990 字,大约阅读时间需要 13 分钟。

 

1。根目录下search.php文件

(1)大概257行

case 'new':                $intro   = ' AND g.is_new = 1';                $intromode ='new';                $ur_here = $_LANG['new_goods'];                break;

之后增加代码

case 'old':                $intro   = ' AND g.is_on_sale =0';                $intromode ='old';                $ur_here = $_LANG['old_goods'];                break;

 

(2)大概370行

$sql   = "SELECT COUNT(*) FROM " .$ecs->table('goods'). " AS g ".        "WHERE g.is_delete = 0 AND g.is_on_sale = 1 AND g.is_alone_sale = 1 $attr_in ".        "AND (( 1 " . $categories . $keywords . $brand . $min_price . $max_price . $intro . $outstock ." ) ".$tag_where." )";

 

替换为

if($_REQUEST['intro']=="old"){$sql   = "SELECT COUNT(*) FROM " .$ecs->table('goods'). " AS g ".        "WHERE g.is_delete = 0 AND  g.is_alone_sale = 1 $attr_in ".        "AND (( 1 " . $categories . $keywords . $brand . $min_price . $max_price . $intro . $outstock ." ) ".$tag_where." )";}else{  $sql   = "SELECT COUNT(*) FROM " .$ecs->table('goods'). " AS g ".        "WHERE g.is_delete = 0 AND g.is_on_sale = 1 AND g.is_alone_sale = 1 $attr_in ".        "AND (( 1 " . $categories . $keywords . $brand . $min_price . $max_price . $intro . $outstock ." ) ".$tag_where." )";}

 

(3)大概390行

$sql = "SELECT g.goods_id, g.goods_sn, g.goods_name, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price AS org_price, ".                "IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ".                "g.promote_price, g.promote_start_date, g.promote_end_date, g.goods_thumb, g.goods_img, g.goods_brief, g.goods_type ".            "FROM " .$ecs->table('goods'). " AS g ".            "LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ".                    "ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ".            "WHERE g.is_delete = 0 AND g.is_on_sale = 1 AND g.is_alone_sale = 1 $attr_in ".                "AND (( 1 " . $categories . $keywords . $brand . $min_price . $max_price . $intro . $outstock . " ) ".$tag_where." ) " .            "ORDER BY $sort $order";

替换为

if($_REQUEST['intro']=="old"){    $sql = "SELECT g.goods_id, g.goods_sn, g.goods_name, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price AS org_price, ".                "IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ".                "g.promote_price, g.promote_start_date, g.promote_end_date, g.goods_thumb, g.goods_img, g.goods_brief, g.goods_type ".            "FROM " .$ecs->table('goods'). " AS g ".            "LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ".                    "ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ".            "WHERE g.is_delete = 0  AND g.is_alone_sale = 1 $attr_in ".                "AND (( 1 " . $categories . $keywords . $brand . $min_price . $max_price . $intro . $outstock . " ) ".$tag_where." ) " .            "ORDER BY $sort $order";   }else{       $sql = "SELECT g.goods_id, g.goods_sn, g.goods_name, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price AS org_price, ".                "IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ".                "g.promote_price, g.promote_start_date, g.promote_end_date, g.goods_thumb, g.goods_img, g.goods_brief, g.goods_type ".            "FROM " .$ecs->table('goods'). " AS g ".            "LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ".                    "ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ".            "WHERE g.is_delete = 0 AND g.is_on_sale = 1 AND g.is_alone_sale = 1 $attr_in ".                "AND (( 1 " . $categories . $keywords . $brand . $min_price . $max_price . $intro . $outstock . " ) ".$tag_where." ) " .            "ORDER BY $sort $order";   }

 

2。修改languages/zh_cn/common.php

在  $_LANG['new_goods'] = '新品上市';  下增加代码
$_LANG['old_goods'] = '最新下架商品';
3。需要此功能的文字上添加链接
search.php?intro=old  例如 :<a href="search.php?intro=old">最新下架</a>

 

 

转载地址:http://wmxua.baihongyu.com/

你可能感兴趣的文章
ajax请求拿到多条数据拼接显示在页面中
查看>>
小程序: 查看正在写的页面
查看>>
Jenkins持续集成环境部署
查看>>
检查磁盘利用率并且定期发送告警邮件
查看>>
MWeb 1.4 新功能介绍二:静态博客功能增强
查看>>
摄像机与绕任意轴旋转
查看>>
rsync 服务器配置过程
查看>>
预处理、const与sizeof相关面试题
查看>>
爬虫豆瓣top250项目-开发文档
查看>>
Elasticsearch增删改查
查看>>
oracle归档日志增长过快处理方法
查看>>
有趣的数学书籍
查看>>
teamviewer 卸载干净
查看>>
多线程设计模式
查看>>
解读自定义UICollectionViewLayout--感动了我自己
查看>>
SqlServer作业指定目标服务器
查看>>
UnrealEngine4.5 BluePrint初始化中遇到编译警告的解决办法
查看>>
User implements HttpSessionBindingListener
查看>>
抽象工厂方法
查看>>
ubuntu apt-get 安装 lnmp
查看>>