[8] ErrorException in Article.php line 33

未定义数组索引: cate_id

  1. //详细
  2. public function get($id,$model='index'){
  3. $where[]=['is_deleted','=',0];
  4. $where[]=['status','=',1];
  5. $where[]=['id','=',$id];
  6. $res = $this->where($where)->find();
  7. $n=$res['num']+1;
  8. $a=$this->where($where)->update(['num'=>$n]);
  9. $res['pre']=$this->getPre($id,$res['cate_id'],$model);
  10. $res['next']=$this->getNext($id,$res['cate_id'],$model);
  11. return $res;
  12. }
  13. //上一篇
  14. public function getPre($id,$cate_id,$model='index')
  15. {
  16. $where[]=['is_deleted','=',0];
  17. $where[]=['status','=',1];
  18. $where[]=['id','<',$id];
  19. $where[]=['cate_id','=',$cate_id];

Call Stack

  1. in Article.php line 33
  2. at Error::appError(8, 'Undefined index: cat...', '/home/wwwroot/zhyx/a...', 33, ['id' => 72, 'model' => 'index', 'where' => [['is_deleted', '=', 0], ['status', '=', 1], ['id', '=', 72]], ...]) in Article.php line 33
  3. at Article->get(72) in Article.php line 44
  4. at Article->detail()
  5. at ReflectionMethod->invokeArgs(object(Article), []) in Container.php line 395
  6. at Container->invokeReflectMethod(object(Article), object(ReflectionMethod), ['id' => '72', 'convert' => false]) in Module.php line 131
  7. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  8. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  9. at Middleware->think\{closure}(object(Request))
  10. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  11. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  12. at Module->exec() in Dispatch.php line 168
  13. at Dispatch->run() in App.php line 432
  14. at App->think\{closure}(object(Request), object(Closure), null)
  15. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  16. at Middleware->think\{closure}(object(Request)) in sys.php line 145
  17. at {closure}(object(Request), object(Closure), null)
  18. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  19. at Middleware->think\{closure}(object(Request)) in common.php line 247
  20. at {closure}(object(Request), object(Closure), null)
  21. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  22. at Middleware->think\{closure}(object(Request))
  23. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  24. at Middleware->dispatch(object(Request)) in App.php line 435
  25. at App->run() in index.php line 20

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER
www
HOME
/home/www
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.024wl.com
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
PATH_INFO
REDIRECT_STATUS
200
SERVER_NAME
024wl.com
SERVER_PORT
80
SERVER_ADDR
219.234.1.7
REMOTE_PORT
20000
REMOTE_ADDR
154.209.214.53
SERVER_SOFTWARE
nginx/1.16.0
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/zhyx/public
DOCUMENT_URI
/index.php
REQUEST_URI
/new/72.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/new/72.html
SCRIPT_FILENAME
/www/wwwroot/zhyx/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1597498155.7607
REQUEST_TIME
1597498155
Environment Variablesempty
ThinkPHP Constants
QINIU_FUNCTIONS_VERSION
7.2.10