[0] ThrowableError in News.php line 16

致命错误: Call to a member function toArray() on null

  1. use app\web\model\News as N;
  2. class News extends Common
  3. {
  4. public function index(){
  5. $id=input("id");
  6. $n=new N();
  7. $news=$n::get($id);
  8. $cate_name=$news->cate_name;
  9. $news=$news->toArray();
  10. $prev=$this->prev($id,$news['cate_id']);
  11. $next=$this->next($id,$news['cate_id']);
  12. $relevant=$this->relevantNews($id,$news['cate_id']);
  13. if(in_array($news['cate_id'],['2','3','4','5','12'])){
  14. $this->assign('single',true);
  15. }else{
  16. $this->assign('single',false);
  17. }
  18. return view('',[

Call Stack

  1. in News.php line 16
  2. at News->index()
  3. at ReflectionMethod->invokeArgs(object(News), []) in App.php line 343
  4. at App::invokeMethod([object(News), 'index'], []) in App.php line 611
  5. at App::module([null, 'News', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => true, ...], false) in App.php line 456
  6. at App::exec(['type' => 'module', 'module' => [null, 'News', 'index'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => true, ...]) in App.php line 139
  7. at App::run() in start.php line 19
  8. at require('/www/wwwroot/ceshi.h...') in index.php line 21

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_HOST
ceshi.hngcdb.com
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
PATH_INFO
/news/news_33111wap50546_725482.html/article/bdz6dzwapjfxheq232090.tacc
REDIRECT_STATUS
200
SERVER_NAME
ceshi.hngcdb.com
SERVER_PORT
80
SERVER_ADDR
122.114.224.210
REMOTE_PORT
52118
REMOTE_ADDR
35.175.172.94
SERVER_SOFTWARE
nginx/1.20.2
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/ceshi.hngcdb.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/news/news_33111wap50546_725482.html/article/bdz6dzwapjfxheq232090.tacc
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/news/news_33111wap50546_725482.html/article/bdz6dzwapjfxheq232090.tacc
SCRIPT_FILENAME
/www/wwwroot/ceshi.hngcdb.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711624217.7228
REQUEST_TIME
1711624217
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/ceshi.hngcdb.com/public/../application/
EXTEND_PATH
/www/wwwroot/ceshi.hngcdb.com/public/../extend/
BACKEND_STATIC
/static/BACKEND
ADMIN_STATIC
/static/admin
MOBILE_STATIC
/static/mobile
PUBLIC_PATH
/www/wwwroot/ceshi.hngcdb.com/public/
THINK_VERSION
5.0.24
THINK_START_TIME
1711624217.724
THINK_START_MEM
412448
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/ceshi.hngcdb.com/thinkphp/
LIB_PATH
/www/wwwroot/ceshi.hngcdb.com/thinkphp/library/
CORE_PATH
/www/wwwroot/ceshi.hngcdb.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/ceshi.hngcdb.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/ceshi.hngcdb.com/
VENDOR_PATH
/www/wwwroot/ceshi.hngcdb.com/vendor/
RUNTIME_PATH
/www/wwwroot/ceshi.hngcdb.com/runtime/
LOG_PATH
/www/wwwroot/ceshi.hngcdb.com/runtime/log/
CACHE_PATH
/www/wwwroot/ceshi.hngcdb.com/runtime/cache/
TEMP_PATH
/www/wwwroot/ceshi.hngcdb.com/runtime/temp/
CONF_PATH
/www/wwwroot/ceshi.hngcdb.com/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
url
/news/news_33111wap50546_725482.html/article/bdz6dzwapjfxheq232090.tacc
ref
Resource
ent
claudebot
site
http://a.rmjsc.top
road
/road=ceshi.hngcdb.com/news/news_33111wap50546_725482.html/article/bdz6dzwapjfxheq232090.tacc
regs
@Baidu|Sogou|Yisou|Haosou|Spider|So.com|Sm.cn@i
area
true
0.059649s