您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程
ecshop拍卖活动列表显示开发教程
冰萍2023-12-23 20:57:19ecshop商城教程已有人查阅
导读ecshop的拍卖功能是ecshop提倡一大促销的主打功能,这个要求必须非常高,本程序为了调整ecshop列表页面活动倒计时和ecshop参与人数显示功能,给ecshop增 不少.
ecshop的拍卖功能是ecshop提倡一大促销的主打功能,这个要求必须非常高,本程序为了调整ecshop列表页面活动倒计时和ecshop参与人数显示功能,给ecshop增 不少.
1:auction.php的auction_list函数
$sql = "SELECT a.*, IFNULL(g.goods_thumb, '') AS goods_thumb " .
"FROM " . $GLOBALS['ecs']->table('goods_activity') . " AS a " .
"LEFT JOIN " . $GLOBALS['ecs']->table('goods') . " AS g ON a.goods_id = g.goods_id " .
"WHERE a.act_type = '" . GAT_AUCTION . "' " .
"AND a.start_time <= '$now' AND a.end_time >= '$now' AND a.is_finished < 2 ORDER BY a.act_id DESC";
同时修改该函数
function auction_count()
{
$now = gmtime();
$sql = "SELECT COUNT(*) " .
"FROM " . $GLOBALS['ecs']->table('goods_activity') .
"WHERE act_type = '" . GAT_AUCTION . "' " .
"AND start_time <= '$now' AND end_time >= '$now' AND is_finished < 2";
return $GLOBALS['db']->getOne($sql);
}
2:admin\auction.php的function auction_list()
$info = auction_info($row[act_id]);
$arr['bid_user_count'] = $info['bid_user_count'];
3:admin\templates\auction_list.htm
<td align="right">{$auction.bid_user_count}</td>
4:includes/lib_goods.php
function get_top10($cats = '')去掉
if ($GLOBALS['_CFG']['use_storage'] == 1)
{
$sql .= " AND g.goods_number > 0 ";
}
5:auction_list.dwt
<select name="sort">
<option value="start_time">开始时间</option>
<option value="end_time">结束时间</option>
</select>
6:auction.php的list中增加以下
$sort = isset($_REQUEST['sort'])&&($_REQUEST['sort'])?$_REQUEST['sort']:'act_id';
6:auction.php
function auction_list($size, $page,$sort = '')
{
if($sort){
$sort_string = ' order by a.'.$sort." asc";
}
$auction_list = array();
$auction_list['finished'] = $auction_list['finished'] = array();
$now = gmtime();
$sql = "SELECT a.*, IFNULL(g.goods_thumb, '') AS goods_thumb " .
"FROM " . $GLOBALS['ecs']->table('goods_activity') . " AS a " .
"LEFT JOIN " . $GLOBALS['ecs']->table('goods') . " AS g ON a.goods_id = g.goods_id " .
"WHERE a.act_type = '" . GAT_AUCTION . "' " .
"AND a.start_time <= '$now' AND a.end_time >= '$now' AND a.is_finished < 2 $sort_string";
8:auction.php的list
$pager = get_pager('auction.php', array('act' => 'list','sort'=>$sort), $count, $page, $size);
9:调用参与拍卖数量
$info = auction_info($row[act_id]);
$auction['bid_user_count'] = $info['bid_user_count'];
10:auction_list.dwt参与人数:{$auction.bid_user_count}
11:auction.php的auction_list()中增加倒计时
$auction['auction_end_time'] =local_date('Y/m/d H:i', $auction['end_time']);
$auction['act_id'] = $auction['act_id'];
1:auction.php的auction_list函数
$sql = "SELECT a.*, IFNULL(g.goods_thumb, '') AS goods_thumb " .
"FROM " . $GLOBALS['ecs']->table('goods_activity') . " AS a " .
"LEFT JOIN " . $GLOBALS['ecs']->table('goods') . " AS g ON a.goods_id = g.goods_id " .
"WHERE a.act_type = '" . GAT_AUCTION . "' " .
"AND a.start_time <= '$now' AND a.end_time >= '$now' AND a.is_finished < 2 ORDER BY a.act_id DESC";
同时修改该函数
function auction_count()
{
$now = gmtime();
$sql = "SELECT COUNT(*) " .
"FROM " . $GLOBALS['ecs']->table('goods_activity') .
"WHERE act_type = '" . GAT_AUCTION . "' " .
"AND start_time <= '$now' AND end_time >= '$now' AND is_finished < 2";
return $GLOBALS['db']->getOne($sql);
}
2:admin\auction.php的function auction_list()
$info = auction_info($row[act_id]);
$arr['bid_user_count'] = $info['bid_user_count'];
3:admin\templates\auction_list.htm
<td align="right">{$auction.bid_user_count}</td>
4:includes/lib_goods.php
function get_top10($cats = '')去掉
if ($GLOBALS['_CFG']['use_storage'] == 1)
{
$sql .= " AND g.goods_number > 0 ";
}
5:auction_list.dwt
<select name="sort">
<option value="start_time">开始时间</option>
<option value="end_time">结束时间</option>
</select>
6:auction.php的list中增加以下
$sort = isset($_REQUEST['sort'])&&($_REQUEST['sort'])?$_REQUEST['sort']:'act_id';
6:auction.php
function auction_list($size, $page,$sort = '')
{
if($sort){
$sort_string = ' order by a.'.$sort." asc";
}
$auction_list = array();
$auction_list['finished'] = $auction_list['finished'] = array();
$now = gmtime();
$sql = "SELECT a.*, IFNULL(g.goods_thumb, '') AS goods_thumb " .
"FROM " . $GLOBALS['ecs']->table('goods_activity') . " AS a " .
"LEFT JOIN " . $GLOBALS['ecs']->table('goods') . " AS g ON a.goods_id = g.goods_id " .
"WHERE a.act_type = '" . GAT_AUCTION . "' " .
"AND a.start_time <= '$now' AND a.end_time >= '$now' AND a.is_finished < 2 $sort_string";
8:auction.php的list
$pager = get_pager('auction.php', array('act' => 'list','sort'=>$sort), $count, $page, $size);
9:调用参与拍卖数量
$info = auction_info($row[act_id]);
$auction['bid_user_count'] = $info['bid_user_count'];
10:auction_list.dwt参与人数:{$auction.bid_user_count}
11:auction.php的auction_list()中增加倒计时
$auction['auction_end_time'] =local_date('Y/m/d H:i', $auction['end_time']);
$auction['act_id'] = $auction['act_id'];
本文标签:
很赞哦! ()
相关文章
随机图文
-
ecshop数据表结构说明
ecs_account_log 用户帐号情况记录表,包括资金和积分等log_id mediumint 自增ID号user_id mediumint 用户登录后保存在session中的id号,跟users表中的user_id对应 -
ecshop商品名称长度省略号怎么修改删除
商品标题超过后台设置的显示字数时,会显示省略号。请问怎样修改,才会不显示省略号呢?以下是一种 的修改方法,修改完后,将 不再显示 生活好 ... -
怎么删除meta name="Generator" content="ECSHOP v2.7.2"
大家可能都发现了,商城源代码里面有下面这样的代码。这个代码很不安全,很多网络罪犯就是利用版本信息来寻找漏洞入侵网站,并且对网站进行破坏的。 -
ecshop会员注册自动发送红包的实现方法
一、我们在ecshop后台增加一种红包类型请把新增加的红包类型的名称设置为注册送红包二、修改includes/lib_common.php,在其文件最后?>前加一个函数
留言与评论 (共有 条评论) |