国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > Ecshop > 正文

ECSHOP開發拍賣活動列表顯示

2024-07-09 22:56:29
字體:
來源:轉載
供稿:網友

ecshop的拍賣功能是ecshop提倡一大促銷的主打功能,這個要求必須非常高,本程序為了調整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.end_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 end_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 align="right">{$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
<select name="sort">
       <option value="start_time">開始時間</option>
    <option value="end_time">結束時間</option>
   
      </select>

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.end_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'];

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 金沙县| 东乡族自治县| 九龙县| 孝感市| 博湖县| 岐山县| 莱西市| 昔阳县| 华容县| 华池县| 北京市| 金昌市| 黔东| 盐池县| 舟山市| 本溪市| 海原县| 德州市| 射阳县| 开封市| 德化县| 安塞县| 连州市| 凤阳县| 昂仁县| 化德县| 陆河县| 岑溪市| 远安县| 南安市| 东源县| 武安市| 巴马| 马尔康县| 龙海市| 普格县| 留坝县| 皋兰县| 玛沁县| 体育| 长白|