[8] ErrorException in News.php line 87

未定义数组索引: category_id

  1. $get =$_GET;
  2. if(isset($get['id']) && $get['id']>0){
  3. $id=$get['id'];
  4. $data = Db::name("BlogNews")->where(['id' =>$id])->update(["look_num"=>Db::raw('look_num+1')]);
  5. $data = Db::name("BlogNews")->where(['id' =>$id])->find();
  6. $data = MediaService::getNewsById($data['id']);
  7. // var_dump($data);exit;
  8. $this->assign("data",$data);
  9. $Catego = Db::name("BlogCategory")->field("id,name")->where(['is_deleted' => '0',"id"=>$data["category_id"]])->find();
  10. $this->assign("Categorylist",$Catego);
  11. return $this->fetch();
  12. }else{
  13. return $this->redirect("index/index");
  14. }
  15. }
  16. }

Call Stack

  1. in News.php line 87
  2. at Error::appError(8, 'Undefined index: cat...', 'D:\freehost\jinhui12...', 87, ['get' => ['id' => '3'], 'id' => '3', 'data' => ['articles' => []]]) in News.php line 87
  3. at News->detail()
  4. at ReflectionMethod->invokeArgs(object(News), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(News), object(ReflectionMethod), ['convert' => false]) in Module.php line 140
  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 145
  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)) in Auth.php line 51
  16. at Auth->handle(object(Request), object(Closure), null)
  17. at call_user_func_array([object(Auth), 'handle'], [object(Request), object(Closure), null]) in Middleware.php line 185
  18. at Middleware->think\{closure}(object(Request))
  19. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  20. at Middleware->dispatch(object(Request)) in App.php line 435
  21. at App->run() in index.php line 23

Environment Variables

GET Data
id
3
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
_FCGI_X_PIPE_
\\.\pipe\IISFCGI-98c8cbb9-dda1-4562-9208-178092bbf492
PHPRC
C:\PHP\5.6\
PHP_FCGI_MAX_REQUESTS
10000
ALLUSERSPROFILE
C:\ProgramData
APPDATA
C:\Windows\system32\config\systemprofile\AppData\Roaming
APP_POOL_CONFIG
C:\inetpub\temp\apppools\25_FreeHost_1\25_FreeHost_1.config
APP_POOL_ID
25_FreeHost_1
CommonProgramFiles
C:\Program Files (x86)\Common Files
CommonProgramFiles(x86)
C:\Program Files (x86)\Common Files
CommonProgramW6432
C:\Program Files\Common Files
COMPUTERNAME
HK-VHOST-220
ComSpec
C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK
NO
LOCALAPPDATA
C:\Windows\system32\config\systemprofile\AppData\Local
NUMBER_OF_PROCESSORS
8
OS
Windows_NT
Path
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;E:\Program Files\Microsoft SQL Server\110\DTS\Binn\;E:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;E:\Program Files\Microsoft SQL Server\110\Tools\Binn\;E:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;E:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;E:\Program Files\MySQL\MySQL Server 5.6\bin;
PATHEXT
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE
x86
PROCESSOR_ARCHITEW6432
AMD64
PROCESSOR_IDENTIFIER
Intel64 Family 6 Model 62 Stepping 4, GenuineIntel
PROCESSOR_LEVEL
6
PROCESSOR_REVISION
3e04
ProgramData
C:\ProgramData
ProgramFiles
C:\Program Files (x86)
ProgramFiles(x86)
C:\Program Files (x86)
ProgramW6432
C:\Program Files
PSModulePath
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\;E:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules\;C:\Program Files\Microsoft Security Client\MpProvider\
PUBLIC
C:\Users\Public
SystemDrive
C:
SystemRoot
C:\Windows
TEMP
C:\Windows\TEMP
TMP
C:\Windows\TEMP
USERDOMAIN
WORKGROUP
USERNAME
HK-VHOST-220$
USERPROFILE
C:\Windows\system32\config\systemprofile
windir
C:\Windows
ORIG_PATH_INFO
/index.php/detail
URL
/index.php
SERVER_SOFTWARE
Microsoft-IIS/8.5
SERVER_PROTOCOL
HTTP/1.1
SERVER_PORT_SECURE
0
SERVER_PORT
80
SERVER_NAME
hnsrzs.net
SCRIPT_NAME
/index.php
SCRIPT_FILENAME
d:\freehost\jinhui1230603\web\index.php
REQUEST_URI
/detail?id=3
REQUEST_METHOD
GET
REMOTE_USER
REMOTE_PORT
20000
REMOTE_HOST
45.196.85.144
REMOTE_ADDR
45.196.85.144
QUERY_STRING
id=3
PATH_TRANSLATED
d:\freehost\jinhui1230603\web\index.php\detail
PATH_INFO
/detail
LOGON_USER
LOCAL_ADDR
103.61.220.135
INSTANCE_META_PATH
/LM/W3SVC/32694003
INSTANCE_NAME
JINHUI1230603_JINHUI1230603.HKHOST182.VHOSTDEMO.COM_JINHUI123
INSTANCE_ID
32694003
HTTPS_SERVER_SUBJECT
HTTPS_SERVER_ISSUER
HTTPS_SECRETKEYSIZE
HTTPS_KEYSIZE
HTTPS
off
GATEWAY_INTERFACE
CGI/1.1
DOCUMENT_ROOT
d:\freehost\jinhui1230603\web
CONTENT_TYPE
CONTENT_LENGTH
0
CERT_SUBJECT
CERT_SERIALNUMBER
CERT_ISSUER
CERT_FLAGS
CERT_COOKIE
AUTH_USER
AUTH_PASSWORD
AUTH_TYPE
APPL_PHYSICAL_PATH
d:\freehost\jinhui1230603\web\
APPL_MD_PATH
/LM/W3SVC/32694003/ROOT
IIS_UrlRewriteModule
7.1.0871.0
WEBSOCKET_VERSION
13
HTTP_X_REWRITE_URL
/detail?id=3
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_HOST
hnsrzs.net
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_CONTENT_LENGTH
0
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php/detail
REQUEST_TIME_FLOAT
1585474325.0124
REQUEST_TIME
1585474325
Environment Variablesempty
ThinkPHP Constants
QINIU_FUNCTIONS_VERSION
7.2.7