一句代码问两问题?
2016-07-07 15:02 来源:www.chinab4c.com 作者:ecshop专家
"AND a.start_time <= '$now' AND a.end_time >= '$now' AND a.is_finished < 2 ORDER BY a.act_id DESC"; 问题1:这句话怎么添加个功能a.end_time - $now <=30分钟这代码要怎么写? 问题2:a.act_id DESC想改成按一口价从低到高排序,加入a.end_price DESC 居然报错,这怎么搞? 这是有关auction.php的问题 /** * 取得某页的拍卖活动 * @paramint$size每页记录数 * @paramint$page当前页 * @returnarray */ function auction_list($size, $page) { $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 ORDER BY a.act_id DESC"; $res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size); while ($row = $GLOBALS['db']->fetchRow($res)) { $ext_info = unserialize($row['ext_info']); $auction = array_merge($row, $ext_info); $auction['status_no'] = auction_status($auction); $auction['start_time'] = local_date($GLOBALS['_CFG']['time_format'], $auction['start_time']); $auction['end_time']= local_date($GLOBALS['_CFG']['time_format'], $auction['end_time']); $auction['formated_start_price'] = price_format($auction['start_price']); $auction['formated_end_price'] = price_format($auction['end_price']); $auction['formated_deposit'] = price_format($auction['deposit']); $auction['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true); $auction['url'] = build_uri('auction', array('auid'=>$auction['act_id'])); if($auction['status_no'] < 2) { $auction_list['under_way'][] = $auction; } else { $auction_list['finished'][] = $auction; } } $auction_list = @array_merge($auction_list['under_way'], $auction_list['finished']); return $auction_list; } |
最近更新
常用插件
- ecshop二次开发详细页面生
插件介绍: ECSHOP系统,在很多时候,很多商品没有人购买,不但购买的人...
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop2.7.1打印发货单插件
ecshop2.7.1打印发货单插件介绍:ecshop2.7.1和以前的ecshop版本不一样,ecs...
- ecshop分类批量扩展插件
ecshop分类批量扩展插件,这个插件是ecshop插件里面比较核心的插件。我们...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
ecshop热门问答
ecshop热门资料
ecshop安装百度
ecshop变量声明
ecshopEC
ecshop兑换
ecshop师傅
修改ecshop的META
ecshop分库存使用
ecshop美心
ecshop情人节
ecshop焦点图
ecshop奖金
ecshop购物车清空
ecshopgoda
ecshop文章问题
ecshop支付接口
ecshop闵行地区
ecshopashx
ecshop诞生
ecshop商品顺序
ecshop商品分类列表页TITLE
ecshop风暴
ecshop女生
ecshop手机浏览器
ecshopcalled
ecshop显示会员价格
centosgolang
ecshop效果
ecshopagain
ecshop搜索结果异常
ecshop改掉