[8] ErrorException in Index.php line 128

未定义数组索引: id

  1. public function newsdetail() {
  2. $this->assign( "nav", 2 );
  3. $id = Request::instance()->param( "id" );
  4. $data = Db::name( 'article' )->where( "id", $id )->find();
  5. $content = Db::name( 'article_content' )->where( "artid", $data[ "id" ] )->find();
  6. $data[ "content" ] = $this->keyword_replace(stripslashes($content[ "content" ]), $this->tags(), 'https://www.dtx.net.cn/newsdetail/');
  7. $cate = Db::name( 'category' )->where( "pid", 2 )->field( "id,name,pid,sort,alias" )->order( 'sort ASC,id ASC' )->select();
  8. $cateName = Db::name( 'category' )->where( "id", $data[ "id" ] )->field( "name" )->find();
  9. //dump($cateName);
  10. //dump($data["cate_id"]);
  11. //exit;
  12. $cateId = Db::name( 'article' )->where( "id", $data[ "id" ] )->field( "cate_id" )->find();
  13. //页面顶部新闻
  14. $lists = Db::name( 'article' )->alias( 'a' )->where( 'cate_id=20' )->join( "tp_article_content c", "a.id = c.artid" )->field( "a.id,a.title,a.keywords,a.cate_id,a.create_name,a.edit_name,a.input_time,a.edit_time, a.thum_image,a.click,c.content" )->order( 'weight asc, id desc' )->paginate( 10 );
  15. $this->assign( 'lists', $lists );

Call Stack

  1. in Index.php line 128
  2. at Error::appError(8, 'Undefined index: id', '/www/wwwroot/dtx.net...', 128, ['id' => 'hk_hsbc', 'data' => ['content' => ''], 'content' => null, ...]) in Index.php line 128
  3. at Index->newsdetail()
  4. at ReflectionMethod->invokeArgs(object(Index), []) in App.php line 224
  5. at App::invokeMethod([object(Index), 'newsdetail'], []) in App.php line 394
  6. at App::module(['home', 'index', 'newsdetail'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 130
  7. at App::run() in start.php line 18
  8. at require('/www/wwwroot/dtx.net...') in index.php line 23

Exception Datas

Error Context
id hk_hsbc
data { "content": "" }
content Resource
cate [ { "id": 19, "name": "\u516c\u53f8\u65b0\u95fb", "pid": 2, "sort": 1, "alias": "company" }, { "id": 20, "name": "\u6700\u65b0\u6d88\u606f", "pid": 2, "sort": 2, "alias": "Message" } ]

Environment Variables

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

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
SCRIPT_FILENAME
/www/wwwroot/dtx.net.cn/index.php
QUERY_STRING
s=/newsdetail/hk_hsbc.html
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/newsdetail/hk_hsbc.html
DOCUMENT_URI
/index.php
DOCUMENT_ROOT
/www/wwwroot/dtx.net.cn
SERVER_PROTOCOL
HTTP/2.0
REQUEST_SCHEME
https
HTTPS
on
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.20.2
REMOTE_ADDR
54.226.25.246
REMOTE_PORT
42604
SERVER_ADDR
172.17.52.113
SERVER_PORT
443
SERVER_NAME
dtx.net.cn
REDIRECT_STATUS
200
PATH_INFO
/newsdetail/hk_hsbc.html
HTTP_HOST
www.dtx.net.cn
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
HTTP_REFERER
https://dtx.net.cn/newsdetail/hk_hsbc.html
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1710817561.4931
REQUEST_TIME
1710817561
Environment Variables
empty

ThinkPHP Constants

SITE_DIRECTORY
APP_PATH
/www/wwwroot/dtx.net.cn/application/
THINK_VERSION
5.0.11
THINK_START_TIME
1710817561.4936
THINK_START_MEM
260584
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/dtx.net.cn/thinkphp/
LIB_PATH
/www/wwwroot/dtx.net.cn/thinkphp/library/
CORE_PATH
/www/wwwroot/dtx.net.cn/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/dtx.net.cn/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/dtx.net.cn/
EXTEND_PATH
/www/wwwroot/dtx.net.cn/extend/
VENDOR_PATH
/www/wwwroot/dtx.net.cn/vendor/
RUNTIME_PATH
/www/wwwroot/dtx.net.cn/runtime/
LOG_PATH
/www/wwwroot/dtx.net.cn/runtime/log/
CACHE_PATH
/www/wwwroot/dtx.net.cn/runtime/cache/
TEMP_PATH
/www/wwwroot/dtx.net.cn/runtime/temp/
CONF_PATH
/www/wwwroot/dtx.net.cn/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false