怎样做出这样的限时抢购出来

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



我在一遍“超简单可用仿京东商城 限时抢购多个促销商品倒计时特效代码下载”

http://bbs.ecshop.com/viewthread.php?tid=115004&highlight=%CF%DE%CA%B1
采用了代码,不过再不能实现文章中的功能,反而在主页头部出现了一大堆“/** * 获得指定分类促销商品,带倒计时信息 * * @access public * @return array */ function myget_promote_goods($cats = '') { $time = gmtime(); $order_type = $GLOBALS['_CFG']['recommend_order']; /* 取得促销lbi的数量限制 */ $num = get_library_number("recommend_promotion"); $sql = 'SELECT g.goods_id, g.goods_name, g.goods_number,g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price, ' . "IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ". "promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, goods_img, b.brand_name, " . "g.is_best, g.is_new, g.is_hot, g.is_promote, RAND() AS rnd " . 'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g ' . 'LEFT JOIN ' . $GLOBALS['ecs']->table('brand') . ' AS b ON b.brand_id = g.brand_id ' . "LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ". "ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ". 'WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 ' . " AND g.is_promote = 1 AND promote_start_date <= '$time' AND promote_end_date >= '$time' "; $sql .= $order_type == 0 ? ' ORDER BY g.sort_order, g.last_update DESC' : ' ORDER BY rnd'; $sql .= " LIMIT $num "; $result = $GLOBALS['db']->getAll($sql); $goods = array(); foreach ($result AS $idx => $row) { if ($row['promote_price'] > 0) { $promote_price = bargain_price($row['promote_price'], $row['promote_start_date'], $row['promote_end_date']); $goods[$idx]['promote_price'] = $promote_price > 0 ? price_format($promote_price) : ''; } else { $goods[$idx]['promote_price'] = ''; } $goods[$idx]['id'] = $row['goods_id']; $goods[$idx]['name'] = $row['goods_name']; $goods[$idx]['num'] = $row['goods_number']; $goods[$idx]['brief'] = $row['goods_brief']; $goods[$idx]['brand_name'] = $row['brand_name']; $goods[$idx]['goods_style_name'] = add_style($row['goods_name'],$row['goods_name_style']); $goods[$idx]['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name']; $goods[$idx]['short_style_name'] = add_style($goods[$idx]['short_name'],$row['goods_name_style']); $goods[$idx]['market_price'] = price_format($row['market_price']); $goods[$idx]['shop_price'] = price_format($row['shop_price']); $goods[$idx]['thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true); $goods[$idx]['goods_img'] = get_image_path($row['goods_id'], $row['goods_img']); $goods[$idx]['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']); //设置时间 if ($time >= $row['promote_start_date'] && $time <= $row['promote_end_date']) { $goods[$idx]['gmt_end_time'] = $row['promote_end_date']; } else { $goods[$idx]['gmt_end_time'] = 0; } } return $goods; }

Loading...





诺基亚N96



”这样的代码
我用的是360模板(gbk)
请问这样实现如图所示的功能

回答:
期待答案???

这个功能,需要付费,才有人给做吧。呵呵。

这个要该代码了