[8] ErrorException in PressController.php line 50

未定义数组索引: addtime

  1. if ($id <= 0) {
  2. return $this->error('参数错误');
  3. }
  4. $NewsModel = Db::name('news');
  5. $info = $NewsModel->where([
  6. ['id', '=', $id]
  7. ])->find();
  8. $info['thumb'] = get_upload_path($info['thumb']);
  9. $info['add_time'] = date('Y-m-d H:i:s', $info['addtime']);
  10. $this->assign([
  11. 'info' => $info,
  12. 'navid' => 19,
  13. ]);
  14. return $this->fetch();
  15. }
  16. }

Call Stack

  1. in PressController.php line 50
  2. at Error::appError(8, 'Undefined index: add...', '/www/wwwroot/demo.sd...', 50, ['id' => 25, 'NewsModel' => object(Query), 'info' => ['thumb' => '']]) in PressController.php line 50
  3. at PressController->read()
  4. at ReflectionMethod->invokeArgs(object(PressController), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(PressController), object(ReflectionMethod), ['id' => '25']) in Module.php line 131
  6. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  7. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  8. at Middleware->think\{closure}(object(Request))
  9. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  10. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  11. at Module->exec() in Dispatch.php line 168
  12. at Dispatch->run() in App.php line 484
  13. at App->think\{closure}(object(Request), object(Closure), null)
  14. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  15. at Middleware->think\{closure}(object(Request))
  16. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  17. at Middleware->dispatch(object(Request)) in App.php line 487
  18. at App->run() in index.php line 33

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST demo.sdwanyue.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME demo.sdwanyue.com
SERVER_PORT 443
SERVER_ADDR 172.17.0.17
REMOTE_PORT 44440
REMOTE_ADDR 54.82.44.149
SERVER_SOFTWARE nginx/1.18.0
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/demo.sdwanyue.com/public
DOCUMENT_URI /index.php
REQUEST_URI /student/press/read/id/25.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/student/press/read/id/25.html
SCRIPT_FILENAME /www/wwwroot/demo.sdwanyue.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711639010.6707
REQUEST_TIME 1711639010
Environment Variablesempty
ThinkPHP Constants
APP_DEBUG 1
CMF_ROOT /www/wwwroot/demo.sdwanyue.com/
CMF_DATA /www/wwwroot/demo.sdwanyue.com/data/
APP_PATH /www/wwwroot/demo.sdwanyue.com/app/
WEB_ROOT /www/wwwroot/demo.sdwanyue.com/public/
HTMLPURIFIER_PREFIX /www/wwwroot/demo.sdwanyue.com/vendor/ezyang/htmlpurifier/library