Fatal error: Call to a member function toArray() on null in /www/wwwroot/127.0.0.1/application/index/controller/Shop.php on line 149

[1] ErrorException in Shop.php line 149

Call to a member function toArray() on null

  1. /*商品详情*/
  2. public function proDet()
  3. {
  4. $id = input('param.id',0,'intval');
  5. // $id = 424;
  6. $map = ['id'=>$id,'is_del'=>0,'is_sale'=>1];
  7. $goodsInfo = model('goods')->where($map)->find()->toArray();
  8. if (!$goodsInfo){
  9. return false;
  10. }
  11. $goodsInfo['price'] = number_format($goodsInfo['price'], 2);
  12. $goodsInfo['oprice'] = number_format($goodsInfo['oprice'], 2);

Call Stack

  1. in Shop.php line 149
  2. at Error::appShutdown()

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
SCRIPT_FILENAME
/www/wwwroot/127.0.0.1/public/index.php
QUERY_STRING
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/index/shop/prodet/id/
DOCUMENT_URI
/index.php//index/shop/prodet/id/
DOCUMENT_ROOT
/www/wwwroot/127.0.0.1/public
SERVER_PROTOCOL
HTTP/1.1
REQUEST_SCHEME
http
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.16.0
REMOTE_ADDR
45.196.86.94
REMOTE_PORT
20000
SERVER_ADDR
172.19.240.141
SERVER_PORT
80
SERVER_NAME
47.103.96.136
REDIRECT_STATUS
200
PATH_INFO
//index/shop/prodet/id/index.php
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_HOST
www.zxlhm.com
HTTP_ACCEPT
*/*
HTTP_ACCEPT_ENCODING
deflate, gzip
PHP_SELF
/index.php//index/shop/prodet/id/index.php
REQUEST_TIME_FLOAT
1590383576.4586
REQUEST_TIME
1590383576
Environment Variables
empty

ThinkPHP Constants

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