[0] ThrowableError in Product.php line 89

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

  1. public function detail()
  2. {
  3. if ($id = input('name')) {
  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. $this->view->assign('proDetail',$productDetail);
  14. $ProList = collection($this->model->where('category_id',$productDetail['category_id'])->order('id desc')->limit(8)->select())->toArray();
  15. foreach($ProList as $key => $v)
  16. {
  17. $ProList[$key]['images'] = explode(',',$v['images']);
  18. }

Call Stack

  1. in Product.php line 89
  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('/home/370197.cloudwa...') in index.php line 17

Environment Variables

GET Data
empty
POST Data
empty
Files
empty

Cookies

lang
en
Session
empty

Server/Request Data

USER
kamavecwzb
HOME
/home/370197.cloudwaysapps.com/kamavecwzb
SCRIPT_NAME
/index.php
REQUEST_URI
/product/detail/name/Travel_Steam_Iront2
QUERY_STRING
REQUEST_METHOD
GET
SERVER_PROTOCOL
HTTP/1.1
GATEWAY_INTERFACE
CGI/1.1
REDIRECT_URL
/product/detail/name/Travel_Steam_Iront2
REMOTE_PORT
33356
SCRIPT_FILENAME
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/public/index.php
SERVER_ADMIN
[no address given]
CONTEXT_DOCUMENT_ROOT
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/public/
CONTEXT_PREFIX
REQUEST_SCHEME
http
DOCUMENT_ROOT
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/public/
REMOTE_ADDR
108.162.219.156
SERVER_PORT
80
SERVER_ADDR
127.0.0.1
SERVER_NAME
www.huayugroup.com
SERVER_SOFTWARE
Apache/2.4.25 (Debian)
SERVER_SIGNATURE
<address>Apache/2.4.25 (Debian) Server at www.huayugroup.com Port 80</address>
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HTTP_X_VARNISH
3283887
HTTP_ACCEPT_ENCODING
gzip
HTTP_X_FORWARDED_FOR
108.162.219.156
HTTP_CDN_LOOP
cloudflare
HTTP_CF_CONNECTING_IP
161.123.205.81
HTTP_CF_REQUEST_ID
031d38e4d10000a2944828f200000001
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_CF_VISITOR
{"scheme":"https"}
HTTP_CF_RAY
59dbc41aec3ca294-EWR
HTTP_CF_IPCOUNTRY
US
HTTP_X_VERSION
54
HTTP_X_APP_USER
kamavecwzb
HTTP_X_APPLICATION
phpstack
HTTP_X_FORWARDED_HOST
www.huayugroup.com
HTTP_X_FORWARDED_PROTO
https
HTTP_HOST
www.huayugroup.com
HTTP_X_REAL_IP
108.162.219.156
HTTP_AUTHORIZATION
HTTPS
on
cw_allowed_ip
0
REDIRECT_STATUS
200
REDIRECT_PATH_INFO
product/detail/name/Travel_Steam_Iront2
REDIRECT_HTTP_AUTHORIZATION
REDIRECT_HTTPS
on
REDIRECT_cw_allowed_ip
0
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1591211969.89
REQUEST_TIME
1591211969
PATH_INFO
product/detail/name/Travel_Steam_Iront2
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/public/../application/
THINK_VERSION
5.0.15
THINK_START_TIME
1591211969.8902
THINK_START_MEM
364064
EXT
.php
DS
/
THINK_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/thinkphp/
LIB_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/thinkphp/library/
CORE_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/thinkphp/library/think/
TRAIT_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/thinkphp/library/traits/
ROOT_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/
EXTEND_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/extend/
VENDOR_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/vendor/
RUNTIME_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/runtime/
LOG_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/runtime/log/
CACHE_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/runtime/cache/
TEMP_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/runtime/temp/
CONF_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
ADDON_PATH
/home/370197.cloudwaysapps.com/kamavecwzb/public_html/addons/