轻源码

  • QingYuanMa.com
  • 全球最大的互联网技术和资源下载平台
搜索
一起源码网 门户 ECShop网店 查看主题

ECSHOP拍卖活动列表显示开发教程

发布者: zldxgz8888 | 发布时间: 2018-5-7 15:11| 查看数: 5592| 评论数: 1|帖子模式

的拍卖功能是提倡一大促销的主打功能,这个要求必须非常高,本程序为了调整ecshop列表页面活动倒计时和ecshop参与人数显示功能,给ecshop增色不少.
1:auction.php的auction_list函数
$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.is_finished < 2 ORDER BY a.act_id DESC";
同时修改该函数
function auction_count()
{
     $now = gmtime();
    $sql = "SELECT COUNT(*) " .
            "FROM " . $GLOBALS['ecs']->table('goods_activity') .
            "WHERE act_type = '" . GAT_AUCTION . "' " .
            "AND start_time = '$now' AND is_finished < 2";
    return $GLOBALS['db']->getOne($sql);
}
2:admin\auction.php的function auction_list()
$info = auction_info($row[act_id]);
$arr['bid_user_count']   = $info['bid_user_count'];
3:admin\templates\auction_list.htm
[td]{$auction.bid_user_count}[/td]
4:includes/lib_goods.php
function get_top10($cats = '')去掉
if ($GLOBALS['_CFG']['use_storage'] == 1)
    {
        $sql .= " AND g.goods_number > 0 ";
    }
5:auction_list.dwt

       开始时间
    结束时间
   
      
6:auction.php的list中增加以下
$sort = isset($_REQUEST['sort'])&&($_REQUEST['sort'])?$_REQUEST['sort']:'act_id';

6:auction.php
function auction_list($size, $page,$sort = '')
{
if($sort){
   $sort_string = ' order by a.'.$sort." asc";
}
    $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.is_finished < 2 $sort_string";

8:auction.php的list
$pager = get_pager('auction.php', array('act' => 'list','sort'=>$sort), $count, $page, $size);
9:调用参与拍卖数量
$info = auction_info($row[act_id]);

   $auction['bid_user_count']   = $info['bid_user_count'];
10:auction_list.dwt参与人数:{$auction.bid_user_count}
11:auction.php的auction_list()中增加倒计时
$auction['auction_end_time']   =local_date('Y/m/d H:i', $auction['end_time']);
$auction['act_id']   = $auction['act_id'];

最新评论

梦想娱乐 发表于 2022-6-13 18:32
ios app

浏览过的版块

轻源码让程序更轻更快

QingYuanMa.com

工作时间 周一至周六 8:00-17:30

侵权处理

客服QQ点击咨询

关注抖音号

定期抽VIP

Copyright © 2016-2021 https://www.171739.xyz/ 滇ICP备13200218号

快速回复 返回顶部 返回列表