[8] ErrorException in Archives.php line 17

未定义数组索引: tablename

  1. public function query($id)
  2. {
  3. $arc=$this->where('id',$id)->find();
  4. $table=get_id_cache_model($arc['channel']);
  5. $result = $this->alias('a')->leftJoin([[ 'arctype t', 'a.typeid=t.id']])->leftJoin([[$table['tablename'].' add', 'a.id=add.aid']])->field('a.id,a.typeid,a.title,a.click,a.writer,a.shorttitle,a.pic,a.pubdate,a.senddate,a.state,a.sort,a.keywords,a.description,t.id as tid,t.typename,t.typenameen,t.typeimg,t.typeurl,t.channeltype,add.*')->where('a.id',$id)->find();
  6. return $result;
  7. }
  8. }

Call Stack

  1. in Archives.php line 17
  2. at Error::appError(8, 'Undefined index: tab...', '/data/home/qxu120552...', 17, ['id' => '451', 'arc' => null, 'table' => []]) in Archives.php line 17
  3. at Archives->query('451') in View.php line 19
  4. at View->index()
  5. at ReflectionMethod->invokeArgs(object(View), []) in Container.php line 395
  6. at Container->invokeReflectMethod(object(View), object(ReflectionMethod), ['tid' => '74', 'id' => '451', 'convert' => false]) in Module.php line 131
  7. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  8. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  9. at Middleware->think\{closure}(object(Request))
  10. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  11. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  12. at Module->exec() in Dispatch.php line 168
  13. at Dispatch->run() in App.php line 432
  14. at App->think\{closure}(object(Request), object(Closure), null)
  15. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  16. at Middleware->think\{closure}(object(Request))
  17. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  18. at Middleware->dispatch(object(Request)) in App.php line 435
  19. at App->run() in index.php line 4

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
DOCUMENT_ROOT /usr/home/qxu1205520091/htdocs
GATEWAY_INTERFACE CGI/1.1
HTTP_ACCEPT */*
HTTP_HOST www.sdepi.org.cn
HTTP_USER_AGENT claudebot
PATH /bin:/usr/bin
PHPRC /var/www/php56/hichina_ini/qxu1205520091
QUERY_STRING
REDIRECT_DOCUMENT_ROOT /usr/home/qxu1205520091/htdocs
REDIRECT_GATEWAY_INTERFACE CGI/1.1
REDIRECT_HTTP_ACCEPT */*
REDIRECT_HTTP_HOST www.sdepi.org.cn
REDIRECT_HTTP_USER_AGENT claudebot
REDIRECT_PATH /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin
REDIRECT_PATH_INFO fwdt/jypx/451.html
REDIRECT_PATH_TRANSLATED redirect:/index.php/451.html
REDIRECT_QUERY_STRING
REDIRECT_REMOTE_ADDR 54.165.248.212
REDIRECT_REMOTE_PORT 33432
REDIRECT_REQUEST_METHOD GET
REDIRECT_REQUEST_URI /fwdt/jypx/451.html
REDIRECT_SCRIPT_FILENAME /usr/home/qxu1205520091/htdocs/fwdt
REDIRECT_SCRIPT_NAME /fwdt
REDIRECT_SCRIPT_URI http://www.sdepi.org.cn/fwdt/jypx/451.html
REDIRECT_SCRIPT_URL /fwdt/jypx/451.html
REDIRECT_SERVER_ADDR 121.42.107.2
REDIRECT_SERVER_ADMIN webmaster@qxu1205520091.my3w.com
REDIRECT_SERVER_NAME www.sdepi.org.cn
REDIRECT_SERVER_PORT 80
REDIRECT_SERVER_PROTOCOL HTTP/1.1
REDIRECT_SERVER_SIGNATURE
REDIRECT_SERVER_SOFTWARE Apache
REDIRECT_STATUS 200
REDIRECT_UNIQUE_ID ZgW4NgofM7YAAGqOg4oAAAAE
REDIRECT_URL /fwdt/jypx/451.html
REMOTE_ADDR 54.165.248.212
REMOTE_PORT 33432
REQUEST_METHOD GET
REQUEST_URI /fwdt/jypx/451.html
SCRIPT_FILENAME /usr/home/qxu1205520091/htdocs/index.php
SCRIPT_NAME /index.php
SCRIPT_URI http://www.sdepi.org.cn/fwdt/jypx/451.html
SCRIPT_URL /fwdt/jypx/451.html
SERVER_ADDR 121.42.107.2
SERVER_ADMIN webmaster@qxu1205520091.my3w.com
SERVER_NAME www.sdepi.org.cn
SERVER_PORT 80
SERVER_PROTOCOL HTTP/1.1
SERVER_SIGNATURE
SERVER_SOFTWARE Apache
UNIQUE_ID ZgW4NgofM7YAAGqOg4oAAAAE
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711650870.8213
REQUEST_TIME 1711650870
Environment Variablesempty
ThinkPHP Constants
DS /
__APP_PATH__ /data/home/qxu1205520091/htdocs/app/
__ROOT_PATH__ /data/home/qxu1205520091/htdocs/
__CONFIG_PATH__ /data/home/qxu1205520091/htdocs/core/config/
__RUNTIME_PATH__ /data/home/qxu1205520091/htdocs/core/runtime/