[0] ThrowableError in Product.php line 95

致命错误: Call to a member function toArray() on null

  1. public function detail()
  2. {
  3. if ($id = input('urlname')) {
  4. if(is_numeric($id)){
  5. $where['id'] = $id;
  6. }else{
  7. $where['urlname'] = $id;
  8. }
  9. }
  10. $productDetail = $this->model->where($where)->find()->toArray();
  11. $productDetail['remark_add']=json_decode($productDetail['remark_add'],true);
  12. $productDetail['images'] = explode(',', $productDetail['images']);
  13. $productDetail['app_images'] = explode(',', $productDetail['app_images']);
  14. $productDetail['app_title'] = explode('|',$productDetail['app_title']);
  15. $productDetail['app']=array();
  16. foreach ($productDetail['app_title'] as $key =>$value){
  17. $productDetail['app'][$key]['app_title']=$productDetail['app_title'][$key];

Call Stack

  1. in Product.php line 95
  2. at Product->detail()
  3. at ReflectionMethod->invokeArgs(object(Product), []) in App.php line 343
  4. at App::invokeMethod([object(Product), 'detail'], []) in App.php line 598
  5. at App::module(['index', 'Product', 'detail'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 456
  6. at App::exec(['type' => 'module', 'module' => 'index/Product/detail'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  7. at App::run() in start.php line 19
  8. at require('/www/wwwroot/jinxind...') in index.php line 16

Environment Variables

GET Data
empty
POST Data
empty
Files
empty

Cookies

lang
en
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_HOST
www.kinsdabottle.com
PATH_INFO
/product/detail/urlname/Wine%20Tumbler%20Blue
REDIRECT_STATUS
200
SERVER_NAME
www.kinsdabottle.com
SERVER_PORT
443
SERVER_ADDR
172.21.93.50
REMOTE_PORT
55992
REMOTE_ADDR
35.175.212.5
SERVER_SOFTWARE
nginx/1.22.1
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/2.0
DOCUMENT_ROOT
/www/wwwroot/jinxinda/public
DOCUMENT_URI
/index.php
REQUEST_URI
/product/detail/urlname/Wine%2520Tumbler%2520Blue
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/product/detail/urlname/Wine%2520Tumbler%2520Blue
SCRIPT_FILENAME
/www/wwwroot/jinxinda/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711617691.6233
REQUEST_TIME
1711617691
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/jinxinda/public/../application/
THINK_VERSION
5.0.15
THINK_START_TIME
1711617691.6245
THINK_START_MEM
404064
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/jinxinda/thinkphp/
LIB_PATH
/www/wwwroot/jinxinda/thinkphp/library/
CORE_PATH
/www/wwwroot/jinxinda/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/jinxinda/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/jinxinda/
EXTEND_PATH
/www/wwwroot/jinxinda/extend/
VENDOR_PATH
/www/wwwroot/jinxinda/vendor/
RUNTIME_PATH
/www/wwwroot/jinxinda/runtime/
LOG_PATH
/www/wwwroot/jinxinda/runtime/log/
CACHE_PATH
/www/wwwroot/jinxinda/runtime/cache/
TEMP_PATH
/www/wwwroot/jinxinda/runtime/temp/
CONF_PATH
/www/wwwroot/jinxinda/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
ADDON_PATH
/www/wwwroot/jinxinda/addons/