我想在auction_list.dwt里的商品列表添加商品的当前价

2016-07-07 15:02 来源:www.chinab4c.com 作者:ecshop专家



lib_goods.php里的

/* 当前价 */
$auction['current_price'] = isset($auction['last_bid']) ? $auction['last_bid']['bid_price'] : $auction['start_price'];
$auction['formated_current_price'] = price_format($auction['current_price'], false);

return $auction;



蓝色这段怎么移植到auction.php绿色这段里,我想在auction_list.dwt里的商品列表添加商品的当前价

/**
* 取得某页的拍卖活动
* @paramint$size每页记录数
* @paramint$page当前页
* @returnarray
*/
function auction_list($size, $page)
{
$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 ORDER BY a.act_id DESC";
$res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size);
while ($row = $GLOBALS['db']->fetchRow($res))
{
$ext_info = unserialize($row['ext_info']);
$auction = array_merge($row, $ext_info);
$auction['status_no'] = auction_status($auction);

$auction['start_time'] = local_date($GLOBALS['_CFG']['time_format'], $auction['start_time']);
$auction['end_time']= local_date($GLOBALS['_CFG']['time_format'], $auction['end_time']);
$auction['formated_start_price'] = price_format($auction['start_price']);
$auction['formated_end_price'] = price_format($auction['end_price']);
$auction['formated_deposit'] = price_format($auction['deposit']);
$auction['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true);
$auction['url'] = build_uri('auction', array('auid'=>$auction['act_id']));

if($auction['status_no'] < 2)
{
$auction_list['under_way'][] = $auction;
}
else
{
$auction_list['finished'][] = $auction;
}
}

$auction_list = @array_merge($auction_list['under_way'], $auction_list['finished']);
return $auction_list;
}

回答:
看不懂 ,等下楼的回答。。最好有详细的代码可以借我参考下。。