[0] ThrowableError in Category.php line 135

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

  1. $this->assign( [
  2. 'list' => $list ,
  3. 'tid' => $category[ 'pid' ] ,
  4. 'webTitle' => "关于我们-湖南联合智为科技有限公司" ,
  5. 'webKeywords' => "关于我们,湖南联合智为科技有限公司" ,
  6. 'webDecs' => "关于我们,湖南联合智为科技有限公司" ,
  7. ] );
  8. } elseif ( $category[ 'pid' ] == 56 || $category[ 'id' ] == 56 ) {//加入我们
  9. $id = $this->request->param( 'id' , '' );
  10. $category = CategoryModule::get( $id )->toArray();
  11. $table = $category[ 'type' ] == 'lists' ? 'cate_list' : 'cate';
  12. $pageList = Db::name( $table )->where( [ 'is_deleted' => 1 , 'status' => 1 , 'pid' => $id ] )->order( 'sort asc,id asc' )->paginate( 10 , false , [
  13. 'type' => 'bootstrap4'
  14. ] );
  15. $list = [];
  16. foreach ( $pageList->items() as $k => $v ) {
  17. $v['content'] = json_decode( $v['content'] , true );
  18. $list[$k] = $v;
  19. }

Call Stack

  1. in Category.php line 135
  2. at Category->index_filter(['id' => 56, 'name' => '加入我们', 'logo' => '', ...]) in Category.php line 41
  3. at Category->index()
  4. at ReflectionMethod->invokeArgs(object(Category), []) in Container.php line 355
  5. at Container->invokeReflectMethod(object(Category), object(ReflectionMethod), ['pid' => '56']) in Module.php line 127
  6. at Module->exec() in Dispatch.php line 165
  7. at Dispatch->run() in App.php line 433
  8. at App->think\{closure}(object(Request), object(Closure), null)
  9. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 142
  10. at Middleware->think\{closure}(object(Request)) in Check.php line 13
  11. at Check->handle(object(Request), object(Closure), null)
  12. at call_user_func_array([object(Check), 'handle'], [object(Request), object(Closure), null]) in Middleware.php line 142
  13. at Middleware->think\{closure}(object(Request)) in Auth.php line 38
  14. at Auth->handle(object(Request), object(Closure), null)
  15. at call_user_func_array([object(Auth), 'handle'], [object(Request), object(Closure), null]) in Middleware.php line 142
  16. at Middleware->think\{closure}(object(Request))
  17. at call_user_func(object(Closure), object(Request)) in Middleware.php line 94
  18. at Middleware->dispatch(object(Request)) in App.php line 456
  19. at App->run() in index.php line 11

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER
nobody
HOME
/
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.hnlhzw.cn
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
REDIRECT_STATUS
200
SERVER_NAME
hnlhzw.cn
SERVER_PORT
80
SERVER_ADDR
172.16.29.134
REMOTE_PORT
20001
REMOTE_ADDR
154.220.30.8
SERVER_SOFTWARE
nginx/1.16.1
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/data/webzhangzhang
DOCUMENT_URI
/index.php
REQUEST_URI
/item/56.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=item/56.html
SCRIPT_FILENAME
/data/webzhangzhang/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1620541651.3851
REQUEST_TIME
1620541651
Environment Variablesempty
ThinkPHP Constants
QINIU_FUNCTIONS_VERSION
7.2.5