[2] ErrorException in Product.php line 68

count(): Parameter must be an array or an object that implements Countable

  1. $map['goods_category_id'] = $param['categoryId'];
  2. }
  3. $tree->init($category_list);
  4. $breadcrumbs = array_merge($breadcrumbs,$tree->get_pos($param['categoryId']));
  5. $child = $tree->get_child($param['categoryId']);
  6. if($child){
  7. if (count($child) == 1) {
  8. $child = $tree->get_child(array_values($child)[0]['id']);
  9. }
  10. if (count($child) == 2) {
  11. if (array_values($child)[0]['name'] == '西药' || array_values($child)[0]['name'] == '西药(抗生素)') {
  12. $tree->get_array(array_values($child)[0]['id']);
  13. $child = $tree->get_array(array_values($child)[1]['id']);
  14. }
  15. }
  16. }
  17. $this->assign('child', $child);
  18. }

Call Stack

  1. in Product.php line 68
  2. at Error::appError(2, 'count(): Parameter m...', '/home/www/scryyy/app...', 68, ['param' => ['categoryId' => '203'], 'map' => ['goods_status' => 1, 'goods_category_id' => ['in', '203,204']], 'breadcrumbs' => [['id' => '', 'name' => '全部商品'], ['category_id' => 3, 'category_name' => '外用辅助功能', 'id' => 3, ...], ['category_id' => 203, 'category_name' => '适用女性', 'id' => 203, ...]], ...])
  3. at count(false) in Product.php line 68
  4. at Product->lists()
  5. at ReflectionMethod->invokeArgs(object(Product), []) in App.php line 343
  6. at App::invokeMethod([object(Product), 'lists'], []) in App.php line 595
  7. at App::module(['home', 'Product', 'lists'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 456
  8. at App::exec(['type' => 'module', 'module' => ['home', 'Product', 'lists']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  9. at App::run() in start.php line 19
  10. at require('/home/www/scryyy/thi...') in index.php line 5

Environment Variables

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

Server/Request Data

USER
apache
HOME
/usr/share/httpd
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.scryyy.com
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
REDIRECT_STATUS
200
SERVER_NAME
www.scryyy.com
SERVER_PORT
80
SERVER_ADDR
172.24.155.40
REMOTE_PORT
20001
REMOTE_ADDR
182.161.61.42
SERVER_SOFTWARE
nginx/1.12.2
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/home/www/scryyy/public
DOCUMENT_URI
/index.php
REQUEST_URI
/home/Product/lists/categoryId/203.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/home/Product/lists/categoryId/203.html
SCRIPT_FILENAME
/home/www/scryyy/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1571358090.2365
REQUEST_TIME
1571358090
PATH_INFO
/home/Product/lists/categoryId/203.html
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/home/www/scryyy/public/../application/
THINK_VERSION
5.0.15
THINK_START_TIME
1571358090.2369
THINK_START_MEM
407896
EXT
.php
DS
/
THINK_PATH
/home/www/scryyy/thinkphp/
LIB_PATH
/home/www/scryyy/thinkphp/library/
CORE_PATH
/home/www/scryyy/thinkphp/library/think/
TRAIT_PATH
/home/www/scryyy/thinkphp/library/traits/
ROOT_PATH
/home/www/scryyy/
EXTEND_PATH
/home/www/scryyy/extend/
VENDOR_PATH
/home/www/scryyy/vendor/
RUNTIME_PATH
/home/www/scryyy/runtime/
LOG_PATH
/home/www/scryyy/runtime/log/
CACHE_PATH
/home/www/scryyy/runtime/cache/
TEMP_PATH
/home/www/scryyy/runtime/temp/
CONF_PATH
/home/www/scryyy/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
ORDER_STATUS_INIT
0
ORDER_STATUS_PAID
1
ORDER_STATUS_CONFIRM
2
ORDER_STATUS_OUTSTOCK
3
ORDER_STATUS_DELIVERY
4
ORDER_STATUS_FINISHED
5
ORDER_STATUS_CLOSED
9