問題:
我在模板里面用GET標簽 調用一個團購商品 ,開始時間(start_time) 結束時間(end_time)
要跟當前時間做個比較,但是 '.TIME.' 無法獲取當前時間。
以下為引用的內容: {get dbsource="ecshop" sql="select * from ecs_goods_activity where act_type=1 and start_time<='.TIME.' and end_time>='.TIME.' order by act_id desc" rows="6"} <li><a href="http://www.**.com/group_buy.php?act=view&id={$r[act_id]}" target="_blank">{str_cut($r[act_name],30,'')}</a></li> {/get} |
回答:
get前邊加上以下代碼:
<?php
$now=time();
?>