ecshop的拍賣功能是ecshop提倡一大促銷的主打功能,這個(gè)要求必須非常高,本程序?yàn)榱苏{(diào)整ecshop列表頁面活動(dòng)倒計(jì)時(shí)和ecshop參與人數(shù)顯示功能,給ecshop增色不少.
1:auction.php的auction_list函數(shù)
$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";
同時(shí)修改該函數(shù)
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">開始時(shí)間</option>
<option value="end_time">結(jié)束時(shí)間</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:調(diào)用參與拍賣數(shù)量
$info = auction_info($row[act_id]);
$auction['bid_user_count'] = $info['bid_user_count'];
10:auction_list.dwt參與人數(shù):{$auction.bid_user_count}
11:auction.php的auction_list()中增加倒計(jì)時(shí)
$auction['auction_end_time'] =local_date('Y/m/d H:i', $auction['end_time']);
$auction['act_id'] = $auction['act_id'];
新聞熱點(diǎn)
疑難解答