[8] ErrorException in Show.php line 46

未定义数组索引: table_name

  1. ->cache(true,3600*24)
  2. ->find();
  3. }
  4. $cid = $data['id']; //当使用ename获取的时候,就要重新给$cid赋值,不然0
  5. $category = Db::name('category')->cache(true,3600*24)->select();
  6. $topid = GetTopid($category,$cid);
  7. $pid = Getpid($category,$cid);
  8. $_GET['cid'] = $cid; //栏目ID
  9. $data['url'] = GetUrl($data);
  10. $table_name = $data['table_name'];
  11. if(\think\facade\Cache::get('cache_show'.$cid.$id)){ //判断缓存是否存在,存在直接取之,不存在跳过 此处$root为栏目id
  12. Db::name($table_name)->where('id',$id)->cache(true,3600*24)->setInc('click',1); //这个方法不能实现实时更新点击量
  13. $content = \think\facade\Cache::get('cache_show'.$cid.$id);
  14. $click = model($table_name)->where('id',$id)->value('click');
  15. }else{
  16. switch ($table_name)
  17. {

Call Stack

  1. in Show.php line 46
  2. at Error::appError(8, 'Undefined index: tab...', '/usr/home/wh-abek7bd...', 46, ['webname' => '...', 'sitekeywords' => '...', 'sitedescription' => '...', ...]) in Show.php line 46
  3. at Show->index()
  4. at ReflectionMethod->invokeArgs(object(Show), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(Show), object(ReflectionMethod), ['keyword' => '哈氏合金', 'ename' => 'Search', 'id' => 'index', ...]) 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 31

Environment Variables

GET Data
keyword 哈氏合金
cid Resource
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
DOCUMENT_ROOT /usr/home/wh-abek7bdstn18ufr881c/htdocs
GATEWAY_INTERFACE CGI/1.1
HTTP_ACCEPT */*
HTTP_CONNECTION close
HTTP_HOST www.wxbxgtg.com
HTTP_REMOTE_HOST 3.230.76.153
HTTP_USER_AGENT claudebot
HTTP_X_FORWARDED_FOR 3.230.76.153
HTTP_X_REAL_IP 3.230.76.153
PATH /bin
PATH_INFO /Search/index.html
PATH_TRANSLATED /usr/home/wh-abek7bdstn18ufr881c/htdocs/index.php
PHPRC /var/www/php70/hichina_ini/wh-abek7bdstn18ufr881c
QUERY_STRING keyword=%E5%93%88%E6%B0%8F%E5%90%88%E9%87%91
REDIRECT_STATUS 200
REMOTE_ADDR 10.0.33.129
REMOTE_PORT 60222
REQUEST_METHOD GET
REQUEST_URI /index.php/Search/index.html?keyword=%E5%93%88%E6%B0%8F%E5%90%88%E9%87%91
SCRIPT_FILENAME /usr/home/wh-abek7bdstn18ufr881c/htdocs/index.php
SCRIPT_NAME /index.php
SERVER_ADDR 10.0.16.22
SERVER_ADMIN webmaster@wh-abek7bdstn18ufr881c.my3w.com
SERVER_NAME www.wxbxgtg.com
SERVER_PORT 80
SERVER_PROTOCOL HTTP/1.0
SERVER_SIGNATURE
SERVER_SOFTWARE Apache
TZ Asia/Shanghai
UNIQUE_ID ZgYD5AoAEBYAKY48l@0AAAAU
PHP_SELF /index.php/Search/index.html
REQUEST_TIME_FLOAT 1711670244.8753
REQUEST_TIME 1711670244
Environment Variablesempty
ThinkPHP Constants
DS /
APP_PATH /usr/home/wh-abek7bdstn18ufr881c/htdocs/application/
APP_DEBUG false