还是调用销售排行图片的问题

2016-07-07 16:34 来源:www.chinab4c.com 作者:ecshop专家

默认的bluesky的模板想在销售排行里调用图片参考以前的帖子 把top10.lbi的代码里面添加了 <img src="{$goods.thumb}" />
发现不能调用
看了一下lib_goods.php的代码 里面是这样写的
  1. $sql = 'SELECT g.goods_id, g.goods_name, g.goods_img, SUM(og.goods_number) as goods_number ' .
  2. 'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g, ' .
  3. $GLOBALS['ecs']->table('order_info') . ' AS o, ' .
  4. $GLOBALS['ecs']->table('order_goods') . ' AS og ' .
  5. "WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 $where $top10_time " .
  6. 'AND og.order_id = o.order_id AND og.goods_id = g.goods_id ' .
  7. "AND o.order_status = '" . OS_CONFIRMED . "' " .
  8. "AND (o.pay_status = '" . PS_PAYED . "' OR o.pay_status = '" . PS_PAYING . "') " .
  9. "AND (o.shipping_status = '" . SS_SHIPPED . "' OR o.shipping_status = '" . SS_RECEIVED . "') ".
  10. 'GROUP BY g.goods_id ORDER BY goods_number DESC, g.goods_id DESC LIMIT ' . $GLOBALS['_CFG']['top_number'];
  11. $arr = $GLOBALS['db']->getAll($sql);
  12. for ($i = 0, $count = count($arr); $i < $count; $i++)
  13. {
  14. $arr[$i]['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ?
  15. sub_str($arr[$i]['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $arr[$i]['goods_name'];
  16. $arr[$i]['url']= build_uri('goods', array('gid' => $arr[$i]['goods_id']), $arr[$i]['goods_name']);
  17. }
  18. return $arr;
  19. }
复制代码
发现没有选择goods_thumb 而是 goods_img,我添加上goods_thumb 调用还是不成功

请问因该怎么修改这个函数阿?
不胜感激


回答:
刚查看了一下数据库 发现goods表里面的goods_img存储的是缩略图那么调用goods_img应该是对的
我修改成<img src="{$goods.goods_img}" /> 还是不行

ok了

你是怎么搞OK的?<img src="{$goods.goods_img}" /> ??