[8] ErrorException in Defaulttem.php line 22

未定义数组索引: id

  1. class Defaulttem extends Base
  2. {
  3. public function default()
  4. {
  5. $request=Request::param();
  6. //获取板块id
  7. $data=[];
  8. $id=$request['id'];
  9. if(!($data[$id] = Cache::store('redis')->get('default_data'.$id)))
  10. {
  11. $data[$id] = NavModel::where(['id'=>$request['id']])->where(['status'=>1,'is_del'=>0])->find();
  12. Cache::store('redis')->set('default_data'.$id, $data[$id]);
  13. }
  14. $this->assign('data',$data[$id]);
  15. //判断是一级目录还是二级目录

Call Stack

  1. in Defaulttem.php line 22
  2. at Error::appError(8, 'Undefined index: id', 'D:\phpStudy18\PHPTut...', 22, ['request' => [], 'data' => []]) in Defaulttem.php line 22
  3. at Defaulttem->default() in News.php line 19
  4. at News->index()
  5. at ReflectionMethod->invokeArgs(object(News), []) in Container.php line 299
  6. at Container->invokeReflectMethod(object(News), object(ReflectionMethod), []) in Module.php line 148
  7. at Module->run() in Url.php line 31
  8. at Url->run() in App.php line 378
  9. at App->think\{closure}(object(Request), object(Closure), null)
  10. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 119
  11. at Middleware->think\{closure}(object(Request))
  12. at call_user_func(object(Closure), object(Request)) in Middleware.php line 74
  13. at Middleware->dispatch(object(Request)) in App.php line 399
  14. at App->run() in index.php line 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookies
taishansteel welcome\ you
Sessionempty
Server/Request Data
ALLUSERSPROFILE C:\ProgramData
APPDATA C:\Users\Administrator\AppData\Roaming
CLIENTNAME SOFT-ZHAIYUSHEN
CommonProgramFiles C:\Program Files (x86)\Common Files
CommonProgramFiles(x86) C:\Program Files (x86)\Common Files
CommonProgramW6432 C:\Program Files\Common Files
COMPUTERNAME TGWEB
ComSpec C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK NO
HOMEDRIVE C:
HOMEPATH \Users\Administrator
LOCALAPPDATA C:\Users\Administrator\AppData\Local
LOGONSERVER \\TGWEB
NUMBER_OF_PROCESSORS 2
OS Windows_NT
Path C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE x86
PROCESSOR_ARCHITEW6432 AMD64
PROCESSOR_IDENTIFIER Intel64 Family 6 Model 85 Stepping 4, GenuineIntel
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 5504
ProgramData C:\ProgramData
ProgramFiles C:\Program Files (x86)
ProgramFiles(x86) C:\Program Files (x86)
ProgramW6432 C:\Program Files
PROMPT $P$G
PSModulePath C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC C:\Users\Public
SESSIONNAME RDP-Tcp#0
SystemDrive C:
SystemRoot C:\Windows
TEMP C:\Users\ADMINI~1\AppData\Local\Temp\2
TMP C:\Users\ADMINI~1\AppData\Local\Temp\2
USERDOMAIN TGWEB
USERDOMAIN_ROAMINGPROFILE TGWEB
USERNAME Administrator
USERPROFILE C:\Users\Administrator
WEBKIT_IGNORE_SSL_ERRORS 1
windir C:\Windows
windows_tracing_flags 3
windows_tracing_logfile C:\BVTBin\Tests\installpackage\csilogfile.log
HTTP_X_FORWARDED_FOR 66.199.112.129
HTTP_CLIENT_IP 66.80.238.227
HTTP_REFERER .cn/index/news/index.html
HTTP_ACCEPT_ENCODING gzip,deflate
HTTP_ACCEPT */*
HTTP_HOST www.urloid.com.cn
HTTP_USER_AGENT Mozilla/5.0 (compatible; bingbot/2.0; +#www.bing.com/bingbot.htm)
REDIRECT_STATUS 200
SERVER_NAME 47.105.123.10
SERVER_PORT 80
SERVER_ADDR 192.168.1.224
REMOTE_PORT 49118
REMOTE_ADDR 142.252.85.226
SERVER_SOFTWARE nginx/1.11.5
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT D:/phpStudy18/PHPTutorial/nginx/html/public
DOCUMENT_URI /index.php
REQUEST_URI /index/news/index.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=//index/news/index.html
PATH_TRANSLATED D:/phpStudy18/PHPTutorial/nginx/html/public
PATH_INFO //index/news/index.html
SCRIPT_FILENAME D:/phpStudy18/PHPTutorial/nginx/html/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1548274579.7058
REQUEST_TIME 1548274579
Environment Variablesempty
ThinkPHP Constantsempty