[0] ThrowableError in News.php line 63

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

  1. $this->assign('local', $local);
  2. return $this->fetch('index');
  3. }
  4. public function detail(){
  5. $id = Request::param('id');
  6. $news = new model\News();
  7. $cateSql = new model\NewsCate();
  8. $list = $news ->where(['trash'=> 1,'is_show'=>1,'id'=>$id]) ->order(['sort','id desc'])-> find();
  9. $img = $list -> newsImg() -> find();
  10. $cate = $list -> newsCate() -> find();
  11. $seo = $list -> newsSeo() -> find();
  12. $list['cate'] = $cate['cate_name'];
  13. $list['img'] = $img['img'];
  14. $list['alt'] = $img['alt'];
  15. $list['title'] = $seo['title'];
  16. $list['keywords'] = $seo['keywords'];
  17. $list['description'] = $seo['description'];
  18. $list['tag'] = $seo['tag'];

Call Stack

  1. in News.php line 63
  2. at News->detail()
  3. at ReflectionMethod->invokeArgs(object(News), []) in Container.php line 395
  4. at Container->invokeReflectMethod(object(News), object(ReflectionMethod), ['page' => '19', 'id' => 'tel', 'convert' => false]) in Module.php line 135
  5. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  6. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  7. at Middleware->think\{closure}(object(Request))
  8. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  9. at Middleware->dispatch(object(Request), 'controller') in Module.php line 140
  10. at Module->exec() in Dispatch.php line 168
  11. at Dispatch->run() in App.php line 432
  12. at App->think\{closure}(object(Request), object(Closure), null)
  13. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  14. at Middleware->think\{closure}(object(Request))
  15. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  16. at Middleware->dispatch(object(Request)) in App.php line 435
  17. at App->run() in index.php line 21

Environment Variables

GET Data
page 19
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
SCRIPT_NAME /index.php
REQUEST_URI /english/news_detail/tel:021-67299971?page=19
QUERY_STRING s=english/news_detail/tel:021-67299971&page=19
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/2.0
GATEWAY_INTERFACE CGI/1.1
REDIRECT_QUERY_STRING s=english/news_detail/tel:021-67299971&page=19
REDIRECT_URL /english/news_detail/tel:021-67299971
REMOTE_PORT 51104
SCRIPT_FILENAME /www/wwwroot/keqin/public/index.php
SERVER_ADMIN webmasterexample.com
CONTEXT_DOCUMENT_ROOT /www/wwwroot/keqin/public
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /www/wwwroot/keqin/public
REMOTE_ADDR 54.163.14.144
SERVER_PORT 443
SERVER_ADDR 43.224.153.87
SERVER_NAME coachchem.com
SERVER_SOFTWARE Apache
SERVER_SIGNATURE <address>Apache Server at coachchem.com Port 443</address>
LD_LIBRARY_PATH /www/server/apache/lib
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_HOST coachchem.com
HTTP_REFERER http://coachchem.com/english/news_detail/tel:021-67299971?page=19
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
proxy-nokeepalive 1
H2_STREAM_TAG 17-3
H2_STREAM_ID 3
H2_PUSHED_ON
H2_PUSHED
H2_PUSH off
H2PUSH off
HTTP2 on
SSL_TLS_SNI coachchem.com
HTTPS on
SCRIPT_URI https://coachchem.com/english/news_detail/tel:021-67299971
SCRIPT_URL /english/news_detail/tel:021-67299971
REDIRECT_STATUS 200
REDIRECT_H2_STREAM_TAG 17-3
REDIRECT_H2_STREAM_ID 3
REDIRECT_H2_PUSHED_ON
REDIRECT_H2_PUSHED
REDIRECT_H2_PUSH off
REDIRECT_H2PUSH off
REDIRECT_HTTP2 on
REDIRECT_SSL_TLS_SNI coachchem.com
REDIRECT_HTTPS on
REDIRECT_SCRIPT_URI https://coachchem.com/english/news_detail/tel:021-67299971
REDIRECT_SCRIPT_URL /english/news_detail/tel:021-67299971
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711639165.1267
REQUEST_TIME 1711639165
Environment Variablesempty
ThinkPHP Constantsempty