DEDECMS后臺(tái)會(huì)員消費(fèi)記錄人性化時(shí)間顯示不準(zhǔn)的解決方法
EDECMS的后臺(tái)會(huì)員消費(fèi)記錄存在BUG,在消費(fèi)時(shí)間后邊跟隨的人性化時(shí)間不準(zhǔn)確,一年前的單子也顯示幾天前。需要進(jìn)行修改。
1、打開include/helpers/time.helper.php,找到
function FloorTime($seconds) { $times = ''; $days = floor(($seconds/86400)%30); $hours = floor(($seconds/3600)%24); $minutes = floor(($seconds/60)%60); $seconds = floor($seconds%60); if($seconds >= 1) $times .= $seconds.'秒'; if($minutes >= 1) $times = $minutes.'分鐘 '.$times; if($hours >= 1) $times = $hours.'小時(shí) '.$times; if($days >= 1) $times = $days.'天'; if($days > 30) return false; $times .= '前'; return str_replace(" ", '', $times); }
替換為以下代碼即可:
function FloorTime($date) { $str = ''; $timer = $date; $diff = $_SERVER['REQUEST_TIME'] - $timer; $day = floor($diff / 86400); $free = $diff % 86400; if($day > 0) { return $day."天前"; }else{ if($free>0){ $hour = floor($free / 3600); $free = $free % 3600; if($hour>0){ return $hour."小時(shí)前"; }else{ if($free>0){ $min = floor($free / 60); $free = $free % 60; if($min>0){ return $min."分鐘前"; }else{ if($free>0){ return $free."秒前"; }else{ return '剛剛'; } } }else{ return '剛剛'; } } }else{ return '剛剛'; } } }
2、打開后臺(tái)管理目錄下的templets/member_operations.htm,找到
({dede:field.mtime function="floorTime(time()-@me,@me)"/})
替換為:文章來源:http://www.zghlxwxcb.cn/news/detail-432630.html
({dede:field.mtime function="floorTime(@me)"/})
更改完畢。以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持yii666。文章來源地址http://www.zghlxwxcb.cn/news/detail-432630.html
到了這里,關(guān)于詳解DEDECMS后臺(tái)會(huì)員消費(fèi)記錄人性化時(shí)間顯示不準(zhǔn)的解決方法的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!