[8] ErrorException in common.php line 238

未定义数组下标: 0

  1. //通过路由获取catid
  2. function get_route_catid(){
  3. $catid = 0;
  4. $route = request()->route();
  5. if(!empty($route['catid'])){
  6. $catid = $route['catid'];
  7. }elseif(!empty($route['catdir1']) || !empty($route['catdir2'])){
  8. $catdir = !empty($route['catdir1']) ? $route['catdir1'] : $route['catdir2'];
  9. $category = array_filter(get_category(), function($t) use ($catdir) { return $t['catdir'] == $catdir; });
  10. $catid = array_keys($category)[0];
  11. }
  12. if(check_catid($catid)){
  13. return $catid;
  14. }else{
  15. exit(myexception('栏目不存在!'));
  16. }
  17. }
  18. //通过路由获取城市
  19. function get_route_city(){

Call Stack

  1. in common.php line 238
  2. at Error::appError(8, 'Undefined offset: 0', 'D:\wwwroot\guanwang\...', 238, ['catid' => 0, 'route' => ['catdir1' => 'Contact.aspx'], 'catdir' => 'Contact.aspx', ...]) in common.php line 238
  3. at get_route_catid() in Index.php line 36
  4. at Index->lists(0)
  5. at assert.exception->invokeArgs(object(Index), [0]) in App.php line 343
  6. at App::invokeMethod([object(Index), 'lists'], []) in App.php line 611
  7. at App::module([null, 'index', 'lists'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 456
  8. at App::exec(['type' => 'module', 'module' => [null, 'index', 'lists'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  9. at App::run() in start.php line 19
  10. at require('D:\wwwroot\guanwang\...') in index.php line 16

Environment Variables

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

Server/Request Data

REDIRECT_STATUS
200
HTTP_REFERER
http://www.btdc.com.cn/
HTTP_CONNECTION
keep-alive
HTTP_HOST
www.btdc.com.cn
HTTP_USER_AGENT
Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)
HTTP_ACCEPT
text/html,image/png,image/jpeg,image/pjpeg,image/x-xbitmap,image/svg+xml,image/gif;q=0.9,*/*;q=0.1
HTTP_ACCEPT_LANGUAGE
zh_TW, en, *
HTTP_ACCEPT_ENCODING
gzip, identity;q=0.9
PATH
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;e:\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;e:\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;e:\Microsoft SQL Server\100\DTS\Binn\;D:\WAMP_PATH\php_71_x64
SystemRoot
C:\Windows
COMSPEC
C:\Windows\system32\cmd.exe
PATHEXT
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR
C:\Windows
SERVER_SIGNATURE
SERVER_SOFTWARE
Apache/2.4.37 (Win64) PHP/7.1.32
SERVER_NAME
www.btdc.com.cn
SERVER_ADDR
192.168.6.7
SERVER_PORT
80
REMOTE_ADDR
27.147.31.48
DOCUMENT_ROOT
D:/wwwroot/guanwang
REQUEST_SCHEME
http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
D:/wwwroot/guanwang
SERVER_ADMIN
webmaster@dummy-host.example.com
SCRIPT_FILENAME
D:/wwwroot/guanwang/index.php
REMOTE_PORT
54902
REDIRECT_URL
/Contact.aspx
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.1
REQUEST_METHOD
GET
QUERY_STRING
REQUEST_URI
/Contact.aspx
SCRIPT_NAME
/index.php
PATH_INFO
/Contact.aspx
PATH_TRANSLATED
redirect:\index.php\Contact.aspx
PHP_SELF
/index.php/Contact.aspx
REQUEST_TIME_FLOAT
1598287220.961
REQUEST_TIME
1598287220
ALL_HTTP
Environment Variables
empty

ThinkPHP Constants

APP_PATH
D:\wwwroot\guanwang/application/
IN_LFCMS
true
THINK_VERSION
5.0.24
THINK_START_TIME
1598287220.9618
THINK_START_MEM
371120
EXT
.php
DS
\
THINK_PATH
D:\wwwroot\guanwang\thinkphp\
LIB_PATH
D:\wwwroot\guanwang\thinkphp\library\
CORE_PATH
D:\wwwroot\guanwang\thinkphp\library\think\
TRAIT_PATH
D:\wwwroot\guanwang\thinkphp\library\traits\
ROOT_PATH
D:\wwwroot\guanwang\
EXTEND_PATH
D:\wwwroot\guanwang\extend\
VENDOR_PATH
D:\wwwroot\guanwang\vendor\
RUNTIME_PATH
D:\wwwroot\guanwang\runtime\
LOG_PATH
D:\wwwroot\guanwang\runtime\log\
CACHE_PATH
D:\wwwroot\guanwang\runtime\cache\
TEMP_PATH
D:\wwwroot\guanwang\runtime\temp\
CONF_PATH
D:\wwwroot\guanwang/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
true