[8] ErrorException in Fagui.php line 31

未定义数组下标: 0

  1. /**
  2. * [detail description]出版法规详情页
  3. * @return array $class 所属栏目信息
  4. */
  5. public function detail()
  6. {
  7. $id = input('get.id');
  8. $select = Db::name('article')->where("id=$id")->select();
  9. $onclick = $select[0]['onclick'] + 1;
  10. // 当前文章的浏览量加1
  11. $result = Db::name('article')->where("id=$id")->update(['onclick' => $onclick]);
  12. if ($result) {
  13. $detail = Db::name('article')->where("id=$id")->select();
  14. foreach ($detail as $value) {
  15. $classid = $value['classid'];
  16. }
  17. // 当前栏目信息
  18. $class = Db::name('nav')->where("id=$classid")->field('url,title')->find();

Call Stack

  1. in Fagui.php line 31
  2. at Error::appError(8, 'Undefined offset: 0', '/alidata/www/stock/a...', 31, ['id' => '992', 'select' => []]) in Fagui.php line 31
  3. at Fagui->detail()
  4. at ReflectionMethod->invokeArgs(object(Fagui), []) in App.php line 234
  5. at App::invokeMethod([object(Fagui), 'detail'], []) in App.php line 401
  6. at App::module(['index', 'fagui', 'detail'], ['app_namespace' => 'app', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 140
  7. at App::run() in start.php line 18
  8. at require('/alidata/www/stock/t...') in index.php line 24

Exception Datas

Error Context
id 992
select []

Environment Variables

GET Data
id 992
POST Dataempty
Filesempty
Cookies
PHPSESSID k497u3rs7ol1lp5kc7139dk322
Sessionempty
Server/Request Data
REDIRECT_STATUS 200
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_HOST www.zyddcm.com
HTTP_ACCEPT */*
HTTP_ACCEPT_ENCODING gzip
HTTP_COOKIE PHPSESSID=k497u3rs7ol1lp5kc7139dk322
PATH /sbin:/usr/sbin:/bin:/usr/bin
LD_LIBRARY_PATH /alidata/server/httpd/lib
SERVER_SIGNATURE
SERVER_SOFTWARE Apache/2.4.2 (Unix) PHP/7.4.28
SERVER_NAME www.zyddcm.com
SERVER_ADDR 10.100.10.9
SERVER_PORT 80
REMOTE_ADDR 104.206.1.218
DOCUMENT_ROOT /alidata/www/stock
REQUEST_SCHEME http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /alidata/www/stock
SERVER_ADMIN you@example.com
SCRIPT_FILENAME /alidata/www/stock/index.php
REMOTE_PORT 49654
REDIRECT_QUERY_STRING s=index/fagui/detail&id=992
REDIRECT_URL /index/fagui/detail
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING s=index/fagui/detail&id=992
REQUEST_URI //index/fagui/detail?id=992
SCRIPT_NAME /index.php
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1660701514.5692
REQUEST_TIME 1660701514
argv [ "s=index\/fagui\/detail&id=992" ]
argc 1
PATH_INFO index/fagui/detail
Environment Variables
TERM xterm
SYSTEMCTL_SKIP_REDIRECT
LD_LIBRARY_PATH /alidata/server/httpd/lib
PATH /sbin:/usr/sbin:/bin:/usr/bin
PWD /
SHLVL 1
SYSTEMCTL_IGNORE_DEPENDENCIES
_ /alidata/server/httpd/bin/httpd
ThinkPHP Constants
APP_PATH /alidata/www/stock/application/
APP_DEBUG true
THINK_VERSION 5.0.4
THINK_START_TIME 1660701514.5702
THINK_START_MEM 400304
EXT .php
DS /
THINK_PATH /alidata/www/stock/thinkphp/
LIB_PATH /alidata/www/stock/thinkphp/library/
CORE_PATH /alidata/www/stock/thinkphp/library/think/
TRAIT_PATH /alidata/www/stock/thinkphp/library/traits/
ROOT_PATH /alidata/www/stock/
EXTEND_PATH /alidata/www/stock/extend/
VENDOR_PATH /alidata/www/stock/vendor/
RUNTIME_PATH /alidata/www/stock/runtime/
LOG_PATH /alidata/www/stock/runtime/log/
CACHE_PATH /alidata/www/stock/runtime/cache/
TEMP_PATH /alidata/www/stock/runtime/temp/
CONF_PATH /alidata/www/stock/application/
CONF_EXT .php
ENV_PREFIX PHP_
IS_CLI false
IS_WIN false