[1] ErrorException in Example.php line 120

Call to a member function toArray() on a non-object

  1. $examples['data'][$k]['category_name'] = cache('categorys')[$v['category_id']]['name'];
  2. }
  3. return $examples;
  4. }
  5. /**
  6. * 获取案例详情
  7. */
  8. function get_details($id){
  9. $result = $this->get($id);
  10. $example = $result->toArray();
  11. $next = $this->where('create_time','<',strtotime($example['create_time']))->where('category_id',$example['category_id'])->order('create_time desc')->find();
  12. $prev = $this->where('create_time','>',strtotime($example['create_time']))->where('category_id',$example['category_id'])->order('create_time asc')->find();
  13. if($prev){
  14. $example['prev'] = $prev->toArray();
  15. $example['prev']['url'] =empty($prev["url"])?url("index/example/show",["id"=>$prev["id"]]):$prev["url"];
  16. }else{
  17. $example['prev'] = array('title'=>'返回列表','url'=>url('index/example/lists',['category_id'=>$example['category_id']]));
  18. }

Call Stack

  1. in Example.php line 120
  2. at Error::appShutdown()

Environment Variables

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

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
REDIRECT_STATUS
200
proxy-nokeepalive
1
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
HTTP_HOST
www.zzqiandu.com
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH
/www/server/apache/lib
SERVER_SIGNATURE
<address>Apache Server at www.zzqiandu.com Port 80</address>
SERVER_SOFTWARE
Apache
SERVER_NAME
www.zzqiandu.com
SERVER_ADDR
172.26.136.151
SERVER_PORT
80
REMOTE_ADDR
18.232.66.188
DOCUMENT_ROOT
/www/wwwroot/zzqiandu.com.cn
REQUEST_SCHEME
http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
/www/wwwroot/zzqiandu.com.cn
SERVER_ADMIN
webmaster@example.com
SCRIPT_FILENAME
/www/wwwroot/zzqiandu.com.cn/index.php
REMOTE_PORT
52626
REDIRECT_URL
/case/79.html
REDIRECT_QUERY_STRING
s=/case/79.html
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.1
REQUEST_METHOD
GET
QUERY_STRING
s=/case/79.html
REQUEST_URI
/case/79.html
SCRIPT_NAME
/index.php
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711703593.5278
REQUEST_TIME
1711703593
PATH_INFO
/case/79.html
Environment Variables
empty

ThinkPHP Constants

LZ_VERSION
2.0.0
LAYUI_VERSION
2.1.5
APP_PATH
/www/wwwroot/zzqiandu.com.cn/application/
THINK_VERSION
5.0.10
THINK_START_TIME
1711703593.5282
THINK_START_MEM
238192
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/zzqiandu.com.cn/thinkphp/
LIB_PATH
/www/wwwroot/zzqiandu.com.cn/thinkphp/library/
CORE_PATH
/www/wwwroot/zzqiandu.com.cn/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/zzqiandu.com.cn/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/zzqiandu.com.cn/
EXTEND_PATH
/www/wwwroot/zzqiandu.com.cn/extend/
VENDOR_PATH
/www/wwwroot/zzqiandu.com.cn/vendor/
RUNTIME_PATH
/www/wwwroot/zzqiandu.com.cn/runtime/
LOG_PATH
/www/wwwroot/zzqiandu.com.cn/runtime/log/
CACHE_PATH
/www/wwwroot/zzqiandu.com.cn/runtime/cache/
TEMP_PATH
/www/wwwroot/zzqiandu.com.cn/runtime/temp/
CONF_PATH
/www/wwwroot/zzqiandu.com.cn/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false