首页推荐的新品怎样按时间排序
2016-07-07 15:21 来源:www.chinab4c.com 作者:ecshop专家
就是首页我设置了显示8件新品,排序按最后更新的显示在最前面。现在我的系统的首页不知道是这么回事,显示的乱七八糟的,不是按最新上的排序,而是显示很早前的商品和最近的商品 |
回答:
你的模版是默认模版么? |
模板是下载的模板,在更多商品seach里显示正常,就首页的问题,这情况哪个文件的代码有关系呢?我试了用系统默认的模板情况一样的,首页新品不是按最新上的显示 |
这论坛真冷啊,几乎问题没人回答 |
这个和模板没任何关系。你看lib_goods.php里面的代码。是按商品排序编码 和 最后更新时间来处理的 ORDER BY g.sort_order, g.last_update DESC |
谢谢楼上,等了几天终于有人回答,我去试下 |
好像看代码没问题 //初始化数据 $type_goods['best'] = array(); $type_goods['new'] = array(); $type_goods['hot'] = array(); $data = read_static_cache('recommend_goods'); if ($data === false) { $sql = 'SELECT g.goods_id, g.is_best, g.is_new, g.is_hot, g.is_promote, b.brand_name,g.sort_order ' . ' FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g ' . ' LEFT JOIN ' . $GLOBALS['ecs']->table('brand') . ' AS b ON b.brand_id = g.brand_id ' . ' WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 AND (g.is_best = 1 OR g.is_new =1 OR g.is_hot = 1)'. ' ORDER BY g.sort_order, g.last_update DESC'; $goods_res = $GLOBALS['db']->getAll($sql); //定义推荐,最新,热门,促销商品 $goods_data['best'] = array(); $goods_data['new'] = array(); $goods_data['hot'] = array(); $goods_data['brand'] = array(); if (!empty($goods_res)) { foreach($goods_res as $data) { if ($data['is_best'] == 1) { $goods_data['best'][] = array('goods_id' => $data['goods_id'], 'sort_order' => $data['sort_order']); } if ($data['is_new'] == 1) { $goods_data['new'][] = array('goods_id' => $data['goods_id'], 'sort_order' => $data['sort_order']); } if ($data['is_hot'] == 1) { $goods_data['hot'][] = array('goods_id' => $data['goods_id'], 'sort_order' => $data['sort_order']); } if ($data['brand_name'] != '') { $goods_data['brand'][$data['goods_id']] = $data['brand_name']; } } } write_static_cache('recommend_goods', $goods_data); } else { $goods_data = $data; } $time = gmtime(); $order_type = $GLOBALS['_CFG']['recommend_order']; |
有高手吗 |
最近更新
常用插件
- ecshop供应商插件免费下载
ecshop供应商插件免费下载...
- ecshop按分类筛选销售排行
ecshop按分类筛选销售排行...
- ecshop快递发货单打印商品
ecshop快递发货单打印商品信息,大家都知道ecshop快递单打印的时候,只能...
- ecshop二次开发售后维修卡
插件介绍: 本插件是用于专门从事电子,信息,软件等售后服务关键比...
- ecshop选择下单时间插件
ecshop选择下单时间插件主要是根据不同的下单配送要求,在ecshop购物车...
ecshop热门问答
ecshop热门资料
ecshop全球
ecshop压缩输出
ecshop文本框
ecshop输入密码
ecshop网上购物
ecshop金额
ecshopmemeber
ecshop显示错位
ecshop红包控制
ecshop外包网站二次开发
ecshop短信群发
ecshop想学
品牌显示
ecshop站点
ecshop直通车
ecshopSXXXL
ecshop入门
ecshop不自动切换
ecshop付費
ecshop紫林商城
ecshop西安
ecshop注销
ecshop高亮
ecshop添加到购物车
ecshophttp
ecshopgood
ecshop节省
ecshop实力
ecshopbegin
ecshope987