[8] ErrorException in News.php line 158

未定义数组下标: 0

  1. public function article(){
  2. $list = CNews::shownews();
  3. $this->assign('list', $list);
  4. $this->newstag();
  5. $alias = input('alias');
  6. $arr = Db::name('news')->where('alias',$alias)->select();
  7. // 获取文章时间
  8. $data = $arr[0]['updatetime'];
  9. $this->assign('data',$data);
  10. // 标题
  11. $this->assign('title',$arr[0]['title']);
  12. $this->assign('arr',$arr);
  13. //新闻3及页面的关键词seo
  14. $seo_title = $arr[0]['seo_title'];
  15. $seo_keywords = $arr[0]['seo_keywords'];
  16. $seo_description = $arr[0]['seo_description'];

Call Stack

  1. in News.php line 158
  2. at Error::appError(8, 'Undefined offset: 0', '/home/changshashengt...', 158, ['list' => [['id' => 93, 'alias' => 'Cd', 'sort' => '液态金属', ...], ['id' => 92, 'alias' => 'GA', 'sort' => '液态金属', ...], ['id' => 91, 'alias' => 'Tin', 'sort' => '液态金属', ...], ...], 'alias' => '', 'arr' => []]) in News.php line 158
  3. at News->article()
  4. at ReflectionMethod->invokeArgs(object(News), []) in App.php line 343
  5. at App::invokeMethod([object(News), 'article'], []) in App.php line 611
  6. at App::module(['index', 'news', 'article'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 457
  7. at App::exec(['type' => 'module', 'module' => ['index', 'news', 'article'], 'convert' => false], ['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('/home/changshashengt...') in index.php line 24

Environment Variables

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

Server/Request Data

REDIRECT_REDIRECT_UNIQUE_ID
ZgWznalXomrVRXkhCRNxxAAAACI
REDIRECT_REDIRECT_PHPRC
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/others
REDIRECT_REDIRECT_STATUS
200
REDIRECT_UNIQUE_ID
ZgWznalXomrVRXkhCRNxxAAAACI
REDIRECT_PHPRC
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/others
REDIRECT_HANDLER
php-cgi
REDIRECT_STATUS
200
UNIQUE_ID
ZgWznalXomrVRXkhCRNxxAAAACI
PHPRC
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/others
HTTP_X_FORWARDED_FOR
34.226.141.207
HTTP_X_REAL_IP
211.149.140.180
HTTP_HOST
metalpad.cn
HTTP_CONNECTION
close
HTTP_FROM_HTTPS
on
HTTP_SSL_FLAG
SSL
HTTP_ACCEPT_ENCODING
gzip
HTTP_X_FORWARDED_PROTO
https
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
PATH
/sbin:/usr/sbin:/bin:/usr/bin
SERVER_SIGNATURE
<address>Apache Server at metalpad.cn Port 80</address>
SERVER_SOFTWARE
Apache
SERVER_NAME
metalpad.cn
SERVER_ADDR
127.0.0.1
SERVER_PORT
80
REMOTE_ADDR
34.226.141.207
DOCUMENT_ROOT
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot
REQUEST_SCHEME
http
CONTEXT_PREFIX
/php-run-as-cgi
CONTEXT_DOCUMENT_ROOT
/usr/php5.6/bin
SERVER_ADMIN
webmaster@changshashengte
SCRIPT_FILENAME
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/index.php
REMOTE_PORT
47458
REDIRECT_URL
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.0
REQUEST_METHOD
GET
QUERY_STRING
REQUEST_URI
/article/%E9%93%9F%E4%BA%A7%E5%93%81%EF%BC%8C%E4%BD%A0%E7%9F%A5%E5%A4%9A%E5%B0%91%EF%BC%9F.html
SCRIPT_NAME
/index.php
PATH_INFO
PATH_TRANSLATED
ORIG_PATH_INFO
ORIG_SCRIPT_NAME
/php-run-as-cgi/php-cgi
ORIG_SCRIPT_FILENAME
/usr/php5.6/bin/php-cgi
ORIG_PATH_TRANSLATED
PHP_SELF
REQUEST_TIME_FLOAT
1711649693.5241
REQUEST_TIME
1711649693
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/application/
THINK_VERSION
5.0.24
THINK_START_TIME
1711649693.5269
THINK_START_MEM
232760
EXT
.php
DS
/
THINK_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/thinkphp/
LIB_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/thinkphp/library/
CORE_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/thinkphp/library/think/
TRAIT_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/thinkphp/library/traits/
ROOT_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/
EXTEND_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/extend/
VENDOR_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/vendor/
RUNTIME_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/runtime/
LOG_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/runtime/log/
CACHE_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/runtime/cache/
TEMP_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/runtime/temp/
CONF_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
PHP_INT_MIN
-9223372036854775808
ADDON_PATH
/home/changshashengtekcbhbaangg1s6h9a1sdhxexnzg8t0e/wwwroot/addons/