[8] ErrorException in Code.php line 149

Trying to get property of non-object

  1. */
  2. public function detail($id)
  3. {
  4. //源码详情页
  5. $model=new \app\common\model\Code();
  6. $info=$model->getDetail($id);
  7. $this->assign('info',$info);
  8. //获取当前发布者信息
  9. $member=\app\common\model\Member::get($info->posts->member_id);
  10. $this->assign('member',$member);
  11. //判断是否已经收藏
  12. $collectModel=new \app\common\model\MemberCollect();
  13. $collectInfo=$collectModel
  14. ->where('posts_id',$id)
  15. ->where('member_id',session('member.id'))
  16. ->find();
  17. $this->assign('collectInfo',$collectInfo);

Call Stack

  1. in Code.php line 149
  2. at Error::appError(8, 'Trying to get proper...', '/www/wwwroot/kaifash...', 149, ['id' => '794', 'model' => object(Code), 'info' => null]) in Code.php line 149
  3. at Code->detail('794')
  4. at ReflectionMethod->invokeArgs(object(Code), ['794']) in Container.php line 395
  5. at Container->invokeReflectMethod(object(Code), object(ReflectionMethod), ['id' => '794', 'convert' => false]) in Module.php line 131
  6. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  7. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  8. at Middleware->think\{closure}(object(Request))
  9. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  10. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  11. at Module->exec() in Dispatch.php line 168
  12. at Dispatch->run() in App.php line 432
  13. at App->think\{closure}(object(Request), object(Closure), null)
  14. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  15. at Middleware->think\{closure}(object(Request))
  16. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  17. at Middleware->dispatch(object(Request)) in App.php line 435
  18. at App->run() in index.php line 22

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
FCGI_ROLE RESPONDER
SCRIPT_FILENAME /www/wwwroot/kaifashu.com/public/index.php
QUERY_STRING s=/code/detail/794
REQUEST_METHOD GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME /index.php
REQUEST_URI /code/detail/794
DOCUMENT_URI /index.php
DOCUMENT_ROOT /www/wwwroot/kaifashu.com/public
SERVER_PROTOCOL HTTP/2.0
REQUEST_SCHEME https
HTTPS on
GATEWAY_INTERFACE CGI/1.1
SERVER_SOFTWARE nginx/1.22.1
REMOTE_ADDR 18.118.166.98
REMOTE_PORT 15752
SERVER_ADDR 10.0.4.6
SERVER_PORT 443
SERVER_NAME kfs.zhuopro.com
REDIRECT_STATUS 200
PATH_INFO
HTTP_HOST www.kaifashu.com
HTTP_ACCEPT */*
HTTP_USER_AGENT claudebot
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1713455702.3818
REQUEST_TIME 1713455702
Environment Variablesempty
ThinkPHP Constants
__ROOT__ ../