DEDECMS后台会员消费记录人性化时间显示不准的解决方法
来源:本站原创
|时间:2021-08-05
|栏目:
dedecms|点击: 次
EDECMS的后台会员消费记录存在BUG,在消费时间后边跟随的人性化时间不准确,一年前的单子也显示几天前。需要进行修改。
1、打开include/helpers/time.helper.php,找到
01 |
function FloorTime($seconds) |
04 |
$days = floor(($seconds/86400)%30); |
05 |
$hours = floor(($seconds/3600)%24); |
06 |
$minutes = floor(($seconds/60)%60); |
07 |
$seconds = floor($seconds%60); |
08 |
if ($seconds >= 1) $ times .= $seconds. '秒' ; |
09 |
if ($minutes >= 1) $ times = $minutes. '分钟 ' .$ times ; |
10 |
if ($hours >= 1) $ times = $hours. '小时 ' .$ times ; |
11 |
if ($days >= 1) $ times = $days. '天' ; |
12 |
if ($days > 30) return false ; |
14 |
return str_replace( " " , '' , $ times ); |
|
替换为以下代码即可:
01 |
function FloorTime($ date ) { |
04 |
$ diff = $_SERVER[ 'REQUEST_TIME' ] - $timer; |
05 |
$day = floor($ diff / 86400); |
06 |
$ free = $ diff % 86400; |
11 |
$hour = floor($ free / 3600); |
17 |
$min = floor($ free / 60); |
|
2、打开后台管理目录下的templets/member_operations.htm,找到
(<font color="#FF0000">{dede:field.mtime function="floorTime(time()-@me,@me)"/}</font>)
替换为:
(<font color="#FF0000">{dede:field.mtime function="floorTime(@me)"/}</font>)
更改完毕。