[8] ErrorException in Goods.php line 59

未定义数组索引: cat_id

  1. // 如果在时间范围内
  2. if ($info['starttime'] <= time() && $info['endtime'] > time()) {
  3. $when['state'] = 1;
  4. $when= $info['endtime'] - time();
  5. } else {
  6. $when['state'] = 2;
  7. $when = 0;
  8. }
  9. // print_r($this->timer(date("Y-m-d",$info['endtime'])));
  10. $cat_id = $info['cat_id'];
  11. $cate = array();
  12. $where = array();
  13. $parent_id = Db::name('Category')->where(['id' => $cat_id])->value('parent_id');
  14. if (!empty($parent_id)) {
  15. $cates = Db::name('Category')->where(['parent_id' => $parent_id])->select();
  16. foreach ($cates as $k => $v) {
  17. $cate[] = $v['id'];
  18. }
  19. $cate[] = $parent_id;

Call Stack

  1. in Goods.php line 59
  2. at Error::appError(8, 'Undefined index: cat...', '/mnt/vdb/www/default...', 59, ['goodsId' => '16470', 'comment' => [], 'info' => ['endtime' => '', 'starttime' => ''], ...]) in Goods.php line 59
  3. at Goods->show()
  4. at ReflectionMethod->invokeArgs(object(Goods), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(Goods), object(ReflectionMethod), ['id' => '16470', 'which' => '', 'search' => '']) 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 21

Environment Variables

GET Data
id 16470
which
search
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST www.5181717.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME 120.77.97.132
SERVER_PORT 443
SERVER_ADDR 120.77.97.132
REMOTE_PORT 59612
REMOTE_ADDR 54.159.186.146
SERVER_SOFTWARE nginx/1.14.0
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /mnt/vdb/www/default/public
DOCUMENT_URI /index.php
REQUEST_URI /index/goods/show?id=16470&which=&search=
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/index/goods/show&id=16470&which=&search=
SCRIPT_FILENAME /mnt/vdb/www/default/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711667576.6673
REQUEST_TIME 1711667576
Environment Variablesempty
ThinkPHP Constants
FILTER_VALIDATE_BOOL 258