#0 [0]Error in Goods.php line 405

Call to a member function toArray() on null

  1. // 商品详情
  2. public function details() {
  3. $id = input('id/d' , 0);
  4. $storeId = $this->getStoreId();
  5. $map[] = ['a.status', '=', 1];
  6. $map[] = ['a.id', '=', $id];
  7. $view = $this->model->with(['brand'])->alias('a')->where($map)
  8. ->join(['jxc_mall_goods_children'=>'g'], 'g.good_id = a.id and g.unittype = 1', 'left')
  9. ->field('a.*, g.txcode')->find()->toArray();
  10. $view['images'] = explode('|', $view['images']);
  11. $view['content'] = htmlspecialchars_decode($view['content']);
  12. $view['minbug'] = $view['minbug'] == 0 ? 1:$view['minbug'];
  13. $view['xgnums'] = $view['xgnums'] == 0 ? 9999:$view['xgnums'];
  14. $userfav = new AccountUserFavorite();
  15. $infofav = $userfav->where('store_id', $storeId)->where('good_id', $id)->where('status', 1)->findOrEmpty();
  16. if(!$infofav->isEmpty()) {
  17. $view['isfav'] = 1;
  18. }else{

Call Stack

  1. in Goods.php line 405
  2. at Goods->details()
  3. at ReflectionMethod->invokeArgs() in Container.php line 344
  4. at Container->invokeReflectMethod() in Controller.php line 110
  5. at Controller->think\route\dispatch\{closure}() in Pipeline.php line 59
  6. at Pipeline->think\{closure}() in Pipeline.php line 66
  7. at Pipeline->then() in Controller.php line 113
  8. at Controller->exec() in Dispatch.php line 90
  9. at Dispatch->run() in Route.php line 772
  10. at Route->think\{closure}() in Pipeline.php line 59
  11. at Pipeline->think\{closure}() in Pipeline.php line 66
  12. at Pipeline->then() in Route.php line 773
  13. at Route->dispatch() in Http.php line 216
  14. at Http->dispatchToRoute() in Http.php line 206
  15. at Http->think\{closure}() in Pipeline.php line 59
  16. at Pipeline->think\{closure}() in MultiApp.php line 71
  17. at MultiApp->think\app\{closure}() in Pipeline.php line 59
  18. at Pipeline->think\{closure}() in Pipeline.php line 66
  19. at Pipeline->then() in MultiApp.php line 72
  20. at MultiApp->handle()
  21. at call_user_func() in Middleware.php line 142
  22. at Middleware->think\{closure}() in Pipeline.php line 85
  23. at Pipeline->think\{closure}() in SessionInit.php line 67
  24. at SessionInit->handle()
  25. at call_user_func() in Middleware.php line 142
  26. at Middleware->think\{closure}() in Pipeline.php line 85
  27. at Pipeline->think\{closure}() in Pipeline.php line 66
  28. at Pipeline->then() in Http.php line 207
  29. at Http->runWithRequest() in Http.php line 170
  30. at Http->run() in index.php line 27

Environment Variables

GET Data
id 930
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_HOST xibao.yingmancang.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME xibao.yingmancang.com
SERVER_PORT 80
SERVER_ADDR 172.18.154.46
REMOTE_PORT 51148
REMOTE_ADDR 44.220.131.93
SERVER_SOFTWARE nginx/1.21.4
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/xibao/public
DOCUMENT_URI /index.php
REQUEST_URI /home/goods/details.html?id=930
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/home/goods/details.html&id=930
SCRIPT_FILENAME /www/wwwroot/xibao/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711627101.1257
REQUEST_TIME 1711627101