分类分类
更新时间:2026-03-29 01:03:24作者:fang
关于ecshop获取点击人气排行榜,具体如下:
两部分。index.php和lib_goods.php
关于涉及到index.dwt的,请将按销量排行的改为from = top_hots_all
index.php增加
$smarty->assign('top_hots_all', get_top10_hot(0)); // 全部人气排行
/**
lib_goods.php lib库增加函数(children取得子类产品id)
* 调用当前人气排行榜
*按点击排列 i<10 显示10个
* @access public
* @param string $cats 查询的分类
* @return array
*/
function get_top10_hot($cats)
{
if (empty($cats))
{
$children = '';
}
else
{
$children = "WHERE ".get_children($cats);
}
$sql = 'SELECT * ' .
' FROM ' . $GLOBALS['ecs']->table('goods') .' g '.
" $children" .
' ORDER BY click_count DESC LIMIT 0 , 10';
$hot = $GLOBALS['db']->getALL($sql);
for ($i = 0; $i < 10; $i++)
{
$hot[$i]['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ?
sub_str($hot[$i]['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $hot[$i]['goods_name'];/*$hot[$i]['goods_name'];*/
$hot[$i]['url'] = build_uri('goods', array('gid' => $hot[$i]['goods_id']), $hot[$i]['goods_name']);
$hot[$i]['name'] = $hot[$i]['goods_name'];
}
return $hot;
}
以上就是本文章全部内容,希望对大家有所帮助。
相关
王道三国策略游戏380.18 MBv0.0.12026-03-28
下载刮个爽手机版休闲益智186.96 MBv1.0.282026-03-28
下载龙符天祭策略游戏756.03 Mv22026-03-28
下载入魂一番赏app网上购物106.66 Mv4.3.52026-03-28
下载童话师经营养成504.02 Mv1.1.52026-03-28
下载Bebo Cam app图像拍照264.51 Mv2.3.02026-03-28
下载纯三国官方正版策略游戏167.24 Mv0.0.12026-03-28
下载Poka Cam app图像拍照74.7 Mv1.8.02026-03-28
下载COLMO app趣味娱乐199.15 Mv2.3.5.22026-03-28
下载愤怒的小鸟变形金刚苹果版休闲游戏439.4 Mv2.39.02026-03-28
下载这也能切苹果版休闲游戏479.6 Mv21342026-03-28
下载口袋吉伊卡哇苹果手机版模拟游戏920.4 Mv2.0.02026-03-28
下载










