国产探花免费观看_亚洲丰满少妇自慰呻吟_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'];

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 黄梅县| 峨边| 彰化市| 大竹县| 广饶县| 云梦县| 固安县| 卓尼县| 竹北市| 东海县| 武夷山市| 格尔木市| 东城区| 抚宁县| 宕昌县| 莱芜市| 海安县| 拉萨市| 星座| 山东省| 科技| 辉县市| 神木县| 孝感市| 泸水县| 绥棱县| 增城市| 定兴县| 乌兰县| 弥勒县| 临潭县| 广饶县| 平遥县| 三门峡市| 稻城县| 菏泽市| 卫辉市| 横峰县| 八宿县| 新津县| 新津县|