[8] ErrorException in Index.php line 127

Trying to get property 'pet_id' of non-object

  1. if( !$pet_id ){ $this->error('找不到页面'); }
  2. if( !$id ){ $this->error('找不到内容'); }
  3. $Pet = TrendPet::get(array('id'=>$pet_id,'status'=>1));
  4. if(!$Pet){
  5. $this->error('找不到宠物');
  6. }
  7. $Post = TrendContent::get(array('id'=>$id,'status'=>1));
  8. if($Post->pet_id != $Pet->id ){
  9. $this->error('找不到内容');
  10. }
  11. $Post->setInc("views", 1); //浏览量+1
  12. $Post->date_fmt = date('Y-m-d',$Post->createtime);
  13. $this->assign('title', $Pet->petname);
  14. $this->assign('pet', $Pet);
  15. $gallery = array();

Call Stack

  1. in Index.php line 127
  2. at Error::appError(8, 'Trying to get proper...', '/www/wwwroot/www.pet...', 127, ['pet_id' => '100193', 'id' => '314', 'Pet' => object(Pets), ...]) in Index.php line 127
  3. at Index->single()
  4. at ReflectionMethod->invokeArgs(object(Index), []) in App.php line 343
  5. at App::invokeMethod([object(Index), 'single'], []) in App.php line 611
  6. at App::module(['trend', 'index', 'single'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 456
  7. at App::exec(['type' => 'module', 'module' => ['trend', 'index', 'single'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  8. at App::run() in start.php line 19
  9. at require('/www/wwwroot/www.pet...') in index.php line 23

Environment Variables

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

Server/Request Data

USER
www
HOME
/home/www
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_HOST
www.pethome.com.cn
PATH_INFO
/trend/100193/314.html
REDIRECT_STATUS
200
SERVER_NAME
www.pethome.com.cn
SERVER_PORT
443
SERVER_ADDR
10.0.24.6
REMOTE_PORT
56282
REMOTE_ADDR
44.202.128.177
SERVER_SOFTWARE
nginx/1.20.2
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/2.0
DOCUMENT_ROOT
/www/wwwroot/www.pethome.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/trend/100193/314.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/trend/100193/314.html
SCRIPT_FILENAME
/www/wwwroot/www.pethome.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711634700.8165
REQUEST_TIME
1711634700
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/www.pethome.com/public/../application/
MAIN_SITE
https://www.pethome.com.cn
CLUB_SITE
https://talk.pethome.com.cn
THINK_VERSION
5.0.24
THINK_START_TIME
1711634700.8168
THINK_START_MEM
404736
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/www.pethome.com/thinkphp/
LIB_PATH
/www/wwwroot/www.pethome.com/thinkphp/library/
CORE_PATH
/www/wwwroot/www.pethome.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/www.pethome.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/www.pethome.com/
EXTEND_PATH
/www/wwwroot/www.pethome.com/extend/
VENDOR_PATH
/www/wwwroot/www.pethome.com/vendor/
RUNTIME_PATH
/www/wwwroot/www.pethome.com/runtime/
LOG_PATH
/www/wwwroot/www.pethome.com/runtime/log/
CACHE_PATH
/www/wwwroot/www.pethome.com/runtime/cache/
TEMP_PATH
/www/wwwroot/www.pethome.com/runtime/temp/
CONF_PATH
/www/wwwroot/www.pethome.com/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
FILTER_VALIDATE_BOOL
258
ADDON_PATH
/www/wwwroot/www.pethome.com/addons/