拍卖页面,我要显示即将开始/已经开始和已经结束的拍卖活动,这段代码要怎么改?

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

因为现在的拍卖活动,只在活动开始的时候才显示,结束之后也不能显示,很不利于拍卖商品的推广和拍卖频道的推广。现在找到了这段代码,但不知道要怎么修改才能将所有条件的拍卖活动都显示出来,烦请各位高人指点,不胜感激。

  1. /**
  2. * 取得某页的拍卖活动
  3. * @param int $size 每页记录数
  4. * @param int $page 当前页
  5. * @return array
  6. */
  7. function auction_list($size, $page)
  8. {
  9. $auction_list = array();
  10. $auction_list['finished'] = $auction_list['finished'] = array();

  11. $now = gmtime();
  12. $sql = "SELECT a.*, IFNULL(g.goods_thumb, '') AS goods_thumb " .
  13. "FROM " . $GLOBALS['ecs']->table('goods_activity') . " AS a " .
  14. "LEFT JOIN " . $GLOBALS['ecs']->table('goods') . " AS g ON a.goods_id = g.goods_id " .
  15. "WHERE a.act_type = '" . GAT_AUCTION . "' " .
  16. "AND a.start_time <= '$now' ORDER BY a.act_id DESC";
  17. $res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size);
  18. while ($row = $GLOBALS['db']->fetchRow($res))
  19. {
  20. $ext_info = unserialize($row['ext_info']);
  21. $auction = array_merge($row, $ext_info);
  22. $auction['status_no'] = auction_status($auction);

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

  30. if($auction['status_no'] < 2)
  31. {
  32. $auction_list['under_way'][] = $auction;
  33. }
  34. else
  35. {
  36. $auction_list['finished'][] = $auction;
  37. }
  38. }

  39. $auction_list = @array_merge($auction_list['under_way'], $auction_list['finished']);
复制代码

回答:
顶起来,希望有人帮忙解决一下,谢谢

继续顶起!

继续顶起!我都找遍了论坛,有请高手来帮忙

没有人愿意往出放,看来技术高手都是些小器货哇。

拍卖结束后
最好能显示为
“刚刚结束的竞拍”

通过显示竞拍的产品和低廉的价格
来吸引消费者的竞拍**。

顶起来!!!!!



显示即将开始/已经开始的解决方案已经有了:
http://bbs.ecshop.com/viewthread.php?tid=101822
显示已经结束的拍卖,如何修改?