[8] ErrorException in Product.php line 38

未定义数组索引: classic_id

  1. public function content($id)
  2. {
  3. $back = Db::name('nav') -> where('title', '产品展示') -> find();
  4. $data = Db::name('product') -> find($id);
  5. $photo = $data['photo'] ;
  6. $data['photo'] = explode(',', $photo);
  7. // var_dump($data);
  8. $classic = Db::name('productclassic') -> where('id', $data['classic_id']) -> find();
  9. // 上一篇
  10. $where_up['id'] = array('lt', input('id'));
  11. $up = DB::name('product') -> where($where_up) -> order('id desc') -> find();
  12. // 下一篇
  13. $where_down['id'] = array('gt', input('id'));
  14. $down = DB::name('product') -> where($where_down) -> find();

Call Stack

  1. in Product.php line 38
  2. at Error::appError(8, 'Undefined index: cla...', '/www/wwwroot/chijian...', 38, ['id' => '217', 'back' => null, 'data' => ['photo' => ['']], ...]) in Product.php line 38
  3. at Product->content('217')
  4. at ReflectionMethod->invokeArgs(object(Product), ['217']) in App.php line 343
  5. at App::invokeMethod([object(Product), 'content'], []) in App.php line 611
  6. at App::module(['index', 'product', 'content'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 456
  7. at App::exec(['type' => 'module', 'module' => ['index', 'product', 'content']], ['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/chijian...') in index.php line 16

Environment Variables

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

Server/Request Data

USER
www
HOME
/home/www
HTTP_HOST
chijianinsight.com
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
PATH_INFO
/index/product/content/id/217.html
REDIRECT_STATUS
200
SERVER_NAME
chijianinsight.com
SERVER_PORT
80
SERVER_ADDR
172.31.249.198
REMOTE_PORT
49398
REMOTE_ADDR
18.234.232.228
SERVER_SOFTWARE
nginx/1.22.1
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/chijianinsight.com
DOCUMENT_URI
/index.php
REQUEST_URI
/index/product/content/id/217.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/index/product/content/id/217.html
SCRIPT_FILENAME
/www/wwwroot/chijianinsight.com/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711623804.6602
REQUEST_TIME
1711623804
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/chijianinsight.com/application/
THINK_VERSION
5.0.24
THINK_START_TIME
1711623804.6607
THINK_START_MEM
378752
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/chijianinsight.com/thinkphp/
LIB_PATH
/www/wwwroot/chijianinsight.com/thinkphp/library/
CORE_PATH
/www/wwwroot/chijianinsight.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/chijianinsight.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/chijianinsight.com/
EXTEND_PATH
/www/wwwroot/chijianinsight.com/extend/
VENDOR_PATH
/www/wwwroot/chijianinsight.com/vendor/
RUNTIME_PATH
/www/wwwroot/chijianinsight.com/runtime/
LOG_PATH
/www/wwwroot/chijianinsight.com/runtime/log/
CACHE_PATH
/www/wwwroot/chijianinsight.com/runtime/cache/
TEMP_PATH
/www/wwwroot/chijianinsight.com/runtime/temp/
CONF_PATH
/www/wwwroot/chijianinsight.com/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false