-
金融理财投资类网站织梦...
-
装修设计类网站织梦模板...
-
五金制品厨房用品类网站...
-
管理咨询培训机构类网站...
-
手机APP游戏下载类网站织...
-
投资理财金融公司类网站...
-
建筑规划施工类网站织梦...
-
民宿景区旅游类网站织梦...
-
花店鲜花配送类网站织梦...
-
天然绿色食品类网站织梦...
-
餐饮加盟培训管理类网站...
-
渔具批发牧渔类网站织梦...
-
中英双语装修建材类网站...
-
语言翻译机构类网站织梦...
-
不秀钢材质钢管类网站织...
-
节能环保锅炉设备类网站...
-
有机生物产品类网站织梦...
-
行业资讯网类网站织梦模...
-
建筑职业学校类网站织梦...
-
特色火锅餐饮加盟店网站...
织梦模板资源站的后台会员消费记录存在BUG,在消费时间后边跟随的人性化时间不准确,一年前的单子也显示几天前。我们分享以下方法修复问题。
打开/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.'小时 '.$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."小时前";}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 '刚刚';}}}
打开/dede/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>)