[8] ErrorException in ListController.php line 15

未定义数组下标: 1

  1. use think\Db;
  2. class ListController extends HomeBaseController
  3. {
  4. public function index()
  5. {
  6. $id = $this->request->param('id', 0, 'intval');
  7. $model = new ChannelModel();
  8. $channel = $model->where('id', $id)->where('status', 1)->find();
  9. $channelPath=$channel['path'];$pid = explode('-',$channelPath)[1];
  10. if($channel['parent_id']==0){
  11. $pchannel = $channel;
  12. }else{
  13. $pchannel = db('channel')->field('id,name')->where(['id'=>$pid])->find();
  14. }
  15. $cids = db('channel')->whereLike('path', "$channelPath-%")->column('id');
  16. array_push($cids,$id);
  17. $childs = db('channel')->field('id,name')->where(['parent_id'=>$pid])->select();
  18. //不是简介类和新闻动态

Call Stack

  1. in ListController.php line 15
  2. at Error::appError(8, 'Undefined offset: 1', '/www/wwwroot/www.osh...', 15, ['id' => 2, 'model' => object(ChannelModel), 'channel' => null, ...]) in ListController.php line 15
  3. at ListController->index()
  4. at ReflectionMethod->invokeArgs(object(ListController), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(ListController), object(ReflectionMethod), ['id' => '2', 'convert' => false]) 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 41

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_HOST www.oshlai.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.oshlai.com
SERVER_PORT 80
SERVER_ADDR 172.19.7.172
REMOTE_PORT 34856
REMOTE_ADDR 44.192.75.131
SERVER_SOFTWARE nginx/1.18.0
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/www.oshlai.com/public
DOCUMENT_URI /index.php
REQUEST_URI /product/
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/product/
SCRIPT_FILENAME /www/wwwroot/www.oshlai.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711623826.187
REQUEST_TIME 1711623826
Environment Variablesempty
ThinkPHP Constants
WEB_ROOT /www/wwwroot/www.oshlai.com/public/
APP_DEBUG true
NO_CACHE_RUNTIME true
TP_ROOT /www/wwwroot/www.oshlai.com/public/../
TP_CONFIG /www/wwwroot/www.oshlai.com/public/../config/
APP_PATH /www/wwwroot/www.oshlai.com/public/../application/
APP_TOKEN_DOMAIN http://www.tpsq.com