[0] ThrowableError in ArticleController.php line 200

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

  1. }else{
  2. return $this->fetch("/$tplName");
  3. }
  4. }
  5. //寻找上级
  6. public function cate_path($cat_id){
  7. $portalCategoryModel = new PortalCategoryModel();
  8. //当前分类
  9. $category = $portalCategoryModel->where(array('is_show' => 1, 'delete_time' => 0, 'id' =>$cat_id))->find()->toArray();
  10. $path=$cat_id;
  11. //寻找上级
  12. while($category['parent_id']<>0){
  13. $cate=$portalCategoryModel->where(array('is_show' => 1, 'delete_time' => 0, 'id' =>$category['parent_id']))->find()->toArray();
  14. $path=$cate['id'].'-'.$path;
  15. $category['parent_id']=$cate['parent_id'];
  16. // pre($category['parent_id']);
  17. }
  18. // $path='0-'.$path;

Call Stack

  1. in ArticleController.php line 200
  2. at ArticleController->cate_path('75') in ArticleController.php line 58
  3. at ArticleController->index()
  4. at ReflectionMethod->invokeArgs(object(ArticleController), []) in App.php line 343
  5. at App::invokeMethod([object(ArticleController), 'index'], []) in App.php line 621
  6. at App::module(['portal', 'article', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => true, ...], true) in App.php line 456
  7. at App::exec(['type' => 'module', 'module' => ['portal', 'article', 'index']], ['app_host' => '', 'app_debug' => true, 'app_trace' => true, ...]) in App.php line 139
  8. at App::run() in index.php line 58

Environment Variables

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

Server/Request Data

USER
www
HOME
/home/www
HTTP_HOST
gg.huiquan.com
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
PATH_INFO
/portal/article/index/cid/75/id/1130.html
REDIRECT_STATUS
200
SERVER_NAME
www.huiquan.com
SERVER_PORT
80
SERVER_ADDR
172.18.61.117
REMOTE_PORT
50268
REMOTE_ADDR
54.163.221.133
SERVER_SOFTWARE
nginx/1.16.1
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/hq.com
DOCUMENT_URI
/index.php
REQUEST_URI
/portal/article/index/cid/75/id/1130.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/portal/article/index/cid/75/id/1130.html
SCRIPT_FILENAME
/www/wwwroot/hq.com/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711636183.8791
REQUEST_TIME
1711636183
Environment Variables
empty

ThinkPHP Constants

APP_DEBUG
true
CMF_ROOT
/www/wwwroot/hq.com/
APP_PATH
/www/wwwroot/hq.com/app/
UPLOAD_PATH
/www/wwwroot/hq.com/upload/
CMF_PATH
/www/wwwroot/hq.com/simplewind/cmf/
PLUGINS_PATH
/www/wwwroot/hq.com/plugins/
EXTEND_PATH
/www/wwwroot/hq.com/simplewind/extend/
VENDOR_PATH
/www/wwwroot/hq.com/simplewind/vendor/
RUNTIME_PATH
/www/wwwroot/hq.com/data/runtime/
THINKCMF_VERSION
5.0.170927
SO
is_top DESC,list_order DESC,published_time DESC,post_id DESC
GSO
is_top DESC,category_relate.list_order DESC,published_time DESC,goods_id DESC
TMPLSO
order:is_top DESC,list_order DESC,published_time DESC,post_id DESC;
TMPLGSO
order:is_top DESC,category_relate.list_order DESC,published_time DESC,goods_id DESC;
WEB_ROOT
/www/wwwroot/hq.com/
THINK_VERSION
5.0.24
THINK_START_TIME
1711636183.8796
THINK_START_MEM
407896
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/hq.com/simplewind/thinkphp/
LIB_PATH
/www/wwwroot/hq.com/simplewind/thinkphp/library/
CORE_PATH
/www/wwwroot/hq.com/simplewind/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/hq.com/simplewind/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/hq.com/
LOG_PATH
/www/wwwroot/hq.com/data/runtime/log/
CACHE_PATH
/www/wwwroot/hq.com/data/runtime/cache/
TEMP_PATH
/www/wwwroot/hq.com/data/runtime/temp/
CONF_PATH
/www/wwwroot/hq.com/app/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
HTMLPURIFIER_PREFIX
/www/wwwroot/hq.com/simplewind/vendor/ezyang/htmlpurifier/library
QINIU_FUNCTIONS_VERSION
7.2.1
IS_WECHAT_FALSE
1
IS_WECHAT_TRUE
2
0.055030s