$mUser = Loader::model('User');
$user = $mUser->get(1)->toArray();执行 toArray() 抛异常:[8] ErrorException in Model.php line 354
A non well formed numeric value encountered
* @param mixed $format 日期格式
* @param bool $timestamp 是否进行时间戳转换
* @return mixed
*/
protected function formatDateTime($time, $format, $timestamp = false)
{
if (false !== strpos($format, '\\')) {
$time = new $format($time);
} elseif (!$timestamp) {
$time = date($format, $time);
}
return $time;
}
/**
* 数据写入 类型转换
* @access public
* @param mixed $value 值
* @param string|array $type 要转换的类型
Call Stack
in Model.php line 354
at Error::appError(8, 'A non well formed nu...', 'C:\wamp64\www\tshop\...', 354, ['time' => '2017年02月15日 12:37:29', 'format' => 'Y-m-d H:i:s', 'timestamp' => false])
at date('Y-m-d H:i:s', '2017年02月15日 12:37:29') in Model.php line 354
at Model->formatDateTime('2017年02月15日 12:37:29', 'Y-m-d H:i:s') in Model.php line 449
at Model->getAttr('create_time') in Model.php line 678
at Model->toArray() in User.php line 44
at User->regist() in User.php line 67
at User->toRegist()
at ReflectionMethod->invokeArgs(object(User), []) in App.php line 224
at App::invokeMethod([object(User), 'toregist'], []) in App.php line 389
at App::module(['home', 'user', 'toRegist'], ['app_namespace' => 'app', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 130
at App::run() in start.php line 18
at require('C:\wamp64\www\tshop\...') in index.php line 17
Exception Datas
Error Context
time 2017年02月15日 12:37:29
format Y-m-d H:i:s
timestamp false求助这是什么原因?ThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。