#0 [8]ErrorException in Goods.php line 34

Trying to access array offset on value of type null

  1. //商品详情
  2. $goodsContent=Db::name('goods_content')->where('goods_id',$goods_id)->find();
  3. //当前位置
  4. $positionData=$this->getPositionByCatId($goodsData['goods_cate_id']);
  5. //是否购买过该商品
  6. $sessionUserData=session('sessionUserData');
  7. // halt($sessionUserData['id']);
  8. $goodschong=Db::name('order')->alias('a')->join('order_goods b','a.id=b.order_id')->where('user_id',$sessionUserData['id'])->where('b.goods_id',$goods_id)->find();
  9. //商品SKU的获取
  10. $goodsStandarData=Db::name('goods_standard')->field('sku')->where('goods_id',$goods_id)->select()->toArray();
  11. $standardList=[];
  12. if($goodsStandarData){
  13. $skuStr='';
  14. foreach($goodsStandarData as $k=>$v){
  15. $skuStr=$skuStr.','.$v['sku'];
  16. }
  17. $skuArr=explode(',',$skuStr);

Call Stack

  1. in Goods.php line 34
  2. at Error->appError(8, 'Trying to access arr...', '/home/wwwz/app/index...', 34, ['goods_id' => '27', 'goodsData' => ['goods_id' => 27, 'goods_name' => '...', 'goods_short_name' => '', ...], 'click' => 776, ...]) in Goods.php line 34
  3. at Goods->index()
  4. at ReflectionMethod->invokeArgs(object(Goods), []) in Container.php line 343
  5. at Container->invokeReflectMethod(object(Goods), object(ReflectionMethod), ['goods_id' => '27']) in Controller.php line 110
  6. at Controller->think\route\dispatch\{closure}(object(Request)) in Pipeline.php line 59
  7. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 66
  8. at Pipeline->then(object(Closure)) in Controller.php line 113
  9. at Controller->exec() in Dispatch.php line 89
  10. at Dispatch->run() in Route.php line 772
  11. at Route->think\{closure}(object(Request)) in Pipeline.php line 59
  12. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 66
  13. at Pipeline->then(object(Closure)) in Route.php line 773
  14. at Route->dispatch(object(Request), object(Closure)) in Http.php line 216
  15. at Http->dispatchToRoute(object(Request)) in Http.php line 206
  16. at Http->think\{closure}(object(Request)) in Pipeline.php line 59
  17. at Pipeline->think\{closure}(object(Request)) in MultiApp.php line 71
  18. at MultiApp->think\app\{closure}(object(Request)) in Pipeline.php line 59
  19. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 66
  20. at Pipeline->then(object(Closure)) in MultiApp.php line 72
  21. at MultiApp->handle(object(Request), object(Closure))
  22. at call_user_func([object(MultiApp), 'handle'], object(Request), object(Closure)) in Middleware.php line 142
  23. at Middleware->think\{closure}(object(Request), object(Closure)) in Pipeline.php line 85
  24. at Pipeline->think\{closure}(object(Request)) in SessionInit.php line 67
  25. at SessionInit->handle(object(Request), object(Closure))
  26. at call_user_func([object(SessionInit), 'handle'], object(Request), object(Closure)) in Middleware.php line 142
  27. at Middleware->think\{closure}(object(Request), object(Closure)) in Pipeline.php line 85
  28. at Pipeline->think\{closure}(object(Request)) in TraceDebug.php line 71
  29. at TraceDebug->handle(object(Request), object(Closure))
  30. at call_user_func([object(TraceDebug), 'handle'], object(Request), object(Closure)) in Middleware.php line 142
  31. at Middleware->think\{closure}(object(Request), object(Closure)) in Pipeline.php line 85
  32. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 66
  33. at Pipeline->then(object(Closure)) in Http.php line 207
  34. at Http->runWithRequest(object(Request)) in Http.php line 170
  35. at Http->run() in index.php line 20

Environment Variables

GET Data
goods_id 27
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_HOST izhuyin.cn
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
REDIRECT_STATUS 200
SERVER_NAME izhuyin.cn
SERVER_PORT 443
SERVER_ADDR 172.31.94.158
REMOTE_PORT 50640
REMOTE_ADDR 18.215.15.122
SERVER_SOFTWARE nginx/1.22.0
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /home/wwwz/public
DOCUMENT_URI /index.php
REQUEST_URI /index/goods/index.html?goods_id=27
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/index/goods/index.html&goods_id=27
PATH_INFO
SCRIPT_FILENAME /home/wwwz/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711625683.6498
REQUEST_TIME 1711625683
argv [ "s=\/index\/goods\/index.html&goods_id=27" ]
argc 1
1.609851s