#0 [0]Error in Content.php line 71

Call to undefined method app\index\controller\Content::assign()

  1. //热门文章
  2. $articleHotRes=array(
  3. 'newsdate'=>time()-7776000,//只判断近90天
  4. );
  5. $articleHotRes=db::name('article')->where('newsdate','>=',$articleHotRes['newsdate'])->alias('art')->join('author aut','art.author = aut.user_id')->join('cate c','c.id = art.cate_id')->field('art.*,aut.niceName,c.name as cate,c.ename')->limit(4)->select();
  6. //最新文章
  7. $articleNewRes=db::name('article')->order('newsdate desc')->alias('art')->join('author aut','art.author = aut.user_id')->join('cate c','c.id = art.cate_id')->field('art.*,aut.niceName,c.name as cate,c.ename')->limit(4)->select();
  8. $this->assign(array(
  9. 'articleRes'=>$articleRes,
  10. 'articleHotRes'=>$articleHotRes,
  11. 'articleNewRes'=>$articleNewRes,
  12. 'author'=>$author,
  13. ));
  14. return view();
  15. }
  16. //媒体资源

Call Stack

  1. in Content.php line 71
  2. at Content->author('20')
  3. at ReflectionMethod->invokeArgs(object(Content), ['20']) in Container.php line 342
  4. at Container->invokeReflectMethod(object(Content), object(ReflectionMethod), ['id' => '20']) in Controller.php line 110
  5. at Controller->think\route\dispatch\{closure}(object(Request)) in Pipeline.php line 59
  6. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 65
  7. at Pipeline->then(object(Closure)) in Controller.php line 113
  8. at Controller->exec() in Dispatch.php line 89
  9. at Dispatch->run() in Route.php line 760
  10. at Route->think\{closure}(object(Request)) in Pipeline.php line 59
  11. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 65
  12. at Pipeline->then(object(Closure)) in Route.php line 761
  13. at Route->dispatch(object(Request), object(Closure)) in Http.php line 210
  14. at Http->dispatchToRoute(object(Request)) in Http.php line 200
  15. at Http->think\{closure}(object(Request)) in Pipeline.php line 59
  16. at Pipeline->think\{closure}(object(Request)) in MultiApp.php line 71
  17. at MultiApp->think\app\{closure}(object(Request)) in Pipeline.php line 59
  18. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 65
  19. at Pipeline->then(object(Closure)) in MultiApp.php line 72
  20. at MultiApp->handle(object(Request), object(Closure))
  21. at call_user_func([object(MultiApp), 'handle'], object(Request), object(Closure)) in Middleware.php line 142
  22. at Middleware->think\{closure}(object(Request), object(Closure)) in Pipeline.php line 84
  23. at Pipeline->think\{closure}(object(Request)) in TraceDebug.php line 71
  24. at TraceDebug->handle(object(Request), object(Closure))
  25. at call_user_func([object(TraceDebug), 'handle'], object(Request), object(Closure)) in Middleware.php line 142
  26. at Middleware->think\{closure}(object(Request), object(Closure)) in Pipeline.php line 84
  27. at Pipeline->think\{closure}(object(Request)) in SessionInit.php line 67
  28. at SessionInit->handle(object(Request), object(Closure))
  29. at call_user_func([object(SessionInit), 'handle'], object(Request), object(Closure)) in Middleware.php line 142
  30. at Middleware->think\{closure}(object(Request), object(Closure)) in Pipeline.php line 84
  31. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 65
  32. at Pipeline->then(object(Closure)) in Http.php line 201
  33. at Http->runWithRequest(object(Request)) in Http.php line 162
  34. at Http->run() in index.php line 20

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_X_ALICDN_DA_VIA 58.215.145.112,180.163.190.249
HTTP_ALI_CDN_APPVIEW_NAME cdn-tengine
HTTP_ACCEPT_ENCODING deflate, gzip
HTTP_ACCEPT */*
HTTP_USER_AGENT Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_ALI_SWIFT_FORCE_CACHE_CONTROL 600
HTTP_X_CLIENT_SCHEME https
HTTP_X_FORWARDED_FOR 154.92.251.178
HTTP_ALI_SWIFT_STAT_HOST www.transany.com
HTTP_ALI_SWIFT_LOG_HOST www.transany.com
HTTP_ALI_CDN_REAL_IP 154.92.251.178
HTTP_ALI_CDN_REAL_PORT 20001
HTTP_EAGLEEYE_TRACEID 3ad7913516012294848984929e
HTTP_VIA cn190.l1, l2et2.l2
HTTP_HOST www.transany.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.transany.com
SERVER_PORT 443
SERVER_ADDR 172.17.194.130
REMOTE_PORT 38338
REMOTE_ADDR 140.205.132.34
SERVER_SOFTWARE nginx/1.16.1
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/transany.com/think60/public
DOCUMENT_URI /index.php
REQUEST_URI /author/20.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/author/20.html
SCRIPT_FILENAME /www/wwwroot/transany.com/think60/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1601229485.0326
REQUEST_TIME 1601229485