[2] ErrorException in helper.php line 582

current() expects parameter 1 to be array, null given

  1. if (!function_exists('collection')) {
  2. /**
  3. * 数组转换为数据集对象
  4. * @param array $resultSet 数据集数组
  5. * @return \think\model\Collection|\think\Collection
  6. */
  7. function collection($resultSet)
  8. {
  9. $item = current($resultSet);
  10. if ($item instanceof Model) {
  11. return \think\model\Collection::make($resultSet);
  12. } else {
  13. return \think\Collection::make($resultSet);
  14. }
  15. }
  16. }

Call Stack

  1. in helper.php line 582
  2. at Error::appError(2, 'current() expects pa...', '/www/wwwroot/webs.ha...', 582, ['resultSet' => null])
  3. at current(null) in helper.php line 582
  4. at collection(null) in Goods.php line 150
  5. at Goods->detail()
  6. at ReflectionMethod->invokeArgs(object(Goods), []) in App.php line 343
  7. at App::invokeMethod([object(Goods), 'detail'], []) in App.php line 611
  8. at App::module(['index', 'goods', 'detail'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 456
  9. at App::exec(['type' => 'module', 'module' => ['index', 'goods', 'detail']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  10. at App::run() in start.php line 19
  11. at require('/www/wwwroot/webs.ha...') in index.php line 24

Environment Variables

GET Data

id
124
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_HOST
hangangfanyi.com
PATH_INFO
/index/goods/detail
REDIRECT_STATUS
200
SERVER_NAME
webs.hangangfanyi.com
SERVER_PORT
443
SERVER_ADDR
172.29.149.162
REMOTE_PORT
38504
REMOTE_ADDR
18.234.139.149
SERVER_SOFTWARE
nginx/1.14.2
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/2.0
DOCUMENT_ROOT
/www/wwwroot/webs.hangangfanyi.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/index/goods/detail?id=124
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/index/goods/detail&id=124
SCRIPT_FILENAME
/www/wwwroot/webs.hangangfanyi.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711650358.699
REQUEST_TIME
1711650358
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/webs.hangangfanyi.com/public/../application/
THINK_VERSION
5.0.24
THINK_START_TIME
1711650358.6994
THINK_START_MEM
367928
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/webs.hangangfanyi.com/thinkphp/
LIB_PATH
/www/wwwroot/webs.hangangfanyi.com/thinkphp/library/
CORE_PATH
/www/wwwroot/webs.hangangfanyi.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/webs.hangangfanyi.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/webs.hangangfanyi.com/
EXTEND_PATH
/www/wwwroot/webs.hangangfanyi.com/extend/
VENDOR_PATH
/www/wwwroot/webs.hangangfanyi.com/vendor/
RUNTIME_PATH
/www/wwwroot/webs.hangangfanyi.com/runtime/
LOG_PATH
/www/wwwroot/webs.hangangfanyi.com/runtime/log/
CACHE_PATH
/www/wwwroot/webs.hangangfanyi.com/runtime/cache/
TEMP_PATH
/www/wwwroot/webs.hangangfanyi.com/runtime/temp/
CONF_PATH
/www/wwwroot/webs.hangangfanyi.com/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
PHP_OS_FAMILY
Linux
ADDON_PATH
/www/wwwroot/webs.hangangfanyi.com/addons/