求助:ECSHOP团购列表如何调用产品大图而不是缩略图

2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家



ECSHOP团购列表页默认调用的是缩略图,<img src="{$group_buy.goods_thumb}" ,团购列表页的图片我需要大图,缩略图太小了,<img src="{$group_buy.goods_goods_img}''我改成这样以后,图片就获取不到,请各位大仙帮忙。。。

团购详情页也一样,<img src="{$gb_goods.goods_thumb}"把thumb改为goods_img 同样调用不到图片

团购详情页改成<img src="{$gb_goods.goods_img}"就可以了,列表页不行

回答:
{$group_buy.goods_img}这样呢




试过了,不行,图片不显示

你们就知道模板调用。
模板调用标签是怎么来的,那是程序赋值的,才能调用,程序没给他赋值,调用一辈子也调不出来呀。
这个需要修改PHP文件
修改 group_buy.php
  1. function group_buy_list($size, $page)
  2. {
  3. 。。。。
  4. }
复制代码
中的
g.goods_thumb 改成 g.goods_img

模板调用不变,还是 <img src="{$group_buy.goods_thumb}"

function group_buy_list($size, $page)
{
/* 取得团购活动 */
$gb_list = array();
$now = gmtime();
$sql = "SELECT b.*, IFNULL(g.goods_img, '') AS goods_thumb, b.act_id AS group_buy_id, ".
"b.start_time AS start_date, b.end_time AS end_date " .
"FROM " . $GLOBALS['ecs']->table('goods_activity') . " AS b " .
"LEFT JOIN " . $GLOBALS['ecs']->table('goods') . " AS g ON b.goods_id = g.goods_id " .
"WHERE b.act_type = '" . GAT_GROUP_BUY . "' " .
"AND b.start_time <= '$now' AND b.is_finished < 3 ORDER BY b.act_id DESC";
$res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size);
while ($group_buy = $GLOBALS['db']->fetchRow($res))
{
$ext_info = unserialize($group_buy['ext_info']);
$group_buy = array_merge($group_buy, $ext_info);

/* 格式化时间 */
$group_buy['formated_start_date']= local_date($GLOBALS['_CFG']['time_format'], $group_buy['start_date']);
$group_buy['formated_end_date']= local_date($GLOBALS['_CFG']['time_format'], $group_buy['end_date']);

/* 格式化保证金 */
$group_buy['formated_deposit'] = price_format($group_buy['deposit'], false);

/* 处理价格阶梯 */
$price_ladder = $group_buy['price_ladder'];
if (!is_array($price_ladder) || empty($price_ladder))
{
$price_ladder = array(array('amount' => 0, 'price' => 0));
}
else
{
foreach ($price_ladder as $key => $amount_price)
{
$price_ladder[$key]['formated_price'] = price_format($amount_price['price']);
}
}
$group_buy['price_ladder'] = $price_ladder;

/* 处理图片 */
if (empty($group_buy['goods_thumb']))
{
$group_buy['goods_thumb'] = get_image_path($group_buy['goods_id'], $group_buy['goods_thumb'], true);
}
/* 处理链接 */
$group_buy['url'] = build_uri('group_buy', array('gbid'=>$group_buy['group_buy_id']));
/* 加入数组 */
$gb_list[] = $group_buy;
}

return $gb_list;
}

红色的部分就是改的,改完之后就加载了系统默认的图片,加载不到团购商品的图片