[8] ErrorException in Service.php line 64

未定义数组索引: cid

  1. Db::name('tongji')->where('id',1)->setInc('view');
  2. return $this->fetch();
  3. }
  4. public function detail(){
  5. $id = input('id');
  6. $data = db('y_service')->where('id',$id)->find();
  7. $data['cid_name'] = db('y_cate_service')->where('id',$data['cid'])->value('name');
  8. $data['pid'] = db('y_cate_service')->where('id',$data['cid'])->value('pid');
  9. $this->assign('data',$data);
  10. //当前 and 当前自己分类cid
  11. $cids = get_all_child(db('y_cate_service')->select(),$data['cid']);
  12. array_push($cids,$data['cid']);
  13. $child_content = db('y_service')->where('cid','in',$cids)->order('sort desc')->select();
  14. foreach ($child_content as $k => $v){
  15. if($v['id'] == $id){
  16. unset($child_content[$k]);

Call Stack

  1. in Service.php line 64
  2. at Error::appError(8, 'Undefined index: cid', '/www/wwwroot/t.bioss...', 64, ['id' => '159', 'data' => ['cid_name' => null]]) in Service.php line 64
  3. at Service->detail()
  4. at ReflectionMethod->invokeArgs(object(Service), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(Service), object(ReflectionMethod), ['id' => '159']) 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 21

Environment Variables

GET Data
id 159
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_REFERER http://biossci.com/home/service/detail.html?id=159
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_ALI_CDN_REAL_IP 23.22.23.162
HTTP_X_CLIENT_SCHEME https
HTTP_X_FORWARDED_FOR 23.22.23.162
HTTP_ALI_SWIFT_STAT_HOST level2.biossci.com
HTTP_ALI_SWIFT_LOG_HOST biossci.com
HTTP_EAGLEEYE_TRACEID 3da0c01117117212261616590e
HTTP_VIA cn6425.l1, kunlun3.cn6425, l2cn3160.l2, cache33.l2cn3160
HTTP_HOST biossci.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.biossci.com
SERVER_PORT 80
SERVER_ADDR 172.16.36.10
REMOTE_PORT 37334
REMOTE_ADDR 112.82.213.53
SERVER_SOFTWARE nginx/1.22.0
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/t.biossci.com/public
DOCUMENT_URI /index.php
REQUEST_URI /home/service/detail.html?id=159
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/home/service/detail.html&id=159
SCRIPT_FILENAME /www/wwwroot/t.biossci.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711721227.2172
REQUEST_TIME 1711721227
Environment Variablesempty
ThinkPHP Constantsempty