[2] ErrorException in Product.php line 34

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

  1. $member_id=Db::name("member")->where(['username'=>input('username')])->value("id");
  2. $class=Db::name("myclass")->where(['member_id'=>$member_id,'pid'=>0])->order("sort desc,id asc")->select();
  3. foreach($class as $key=>$item){
  4. $class[$key]["subclass"]=Db::name("myclass")->where(['pid'=>$item['id']])->select();
  5. }
  6. //查询店铺导航
  7. $nav=Db::name("company_nav")->where(['member_id'=>$member_id])->find();
  8. $nav["nav"]=json_decode($nav['nav'],true);
  9. //按照排序值排序
  10. $sort = array_column($nav["nav"],'sort');
  11. array_multisort($sort,SORT_DESC,$nav["nav"]);
  12. $this->view->assign("class",$class);
  13. $this->view->assign("nav",$nav);
  14. }
  15. }
  16. public function get_tags($title,$num=null){
  17. $pscws = new Pscws('utf8');
  18. $pscws->set_dict(FENCI_PATH . 'dict.utf8.xdb');

Call Stack

  1. in Product.php line 34
  2. at Error::appError(2, 'array_column() expec...', '/home/acgroot/s02/ap...', 34, ['member_id' => null, 'class' => [], 'nav' => ['nav' => null]])
  3. at array_column(null, 'sort') in Product.php line 34
  4. at Product->__construct()
  5. at ReflectionClass->newInstanceArgs([]) in App.php line 359
  6. at App::invokeClass('app\index\controller...') in Loader.php line 479
  7. at Loader::controller('product', 'controller', false, 'Error') in App.php line 580
  8. at App::module(['index', 'product', 'comshow'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 456
  9. at App::exec(['type' => 'module', 'module' => ['index', 'product', 'comshow'], 'convert' => false], ['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('/home/acgroot/s02/th...') in index.php line 28

Environment Variables

GET Data
empty
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
acgjl.qunke.com
PATH_INFO
/company/jlguangfu/productshow/84
REDIRECT_STATUS
200
SERVER_NAME
jlacg.baijiaxuegong.com
SERVER_PORT
443
SERVER_ADDR
10.7.2.4
REMOTE_PORT
33468
REMOTE_ADDR
18.206.12.31
SERVER_SOFTWARE
nginx/1.16.1
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/2.0
DOCUMENT_ROOT
/home/acgroot/s02/public
DOCUMENT_URI
/index.php
REQUEST_URI
/company/jlguangfu/productshow/84
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/company/jlguangfu/productshow/84
SCRIPT_FILENAME
/home/acgroot/s02/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711631317.919
REQUEST_TIME
1711631317
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/home/acgroot/s02/public/../application/
FENCI_PATH
/home/acgroot/s02/public/assets/dict/
THINK_VERSION
5.0.24
THINK_START_TIME
1711631317.9193
THINK_START_MEM
381328
EXT
.php
DS
/
THINK_PATH
/home/acgroot/s02/thinkphp/
LIB_PATH
/home/acgroot/s02/thinkphp/library/
CORE_PATH
/home/acgroot/s02/thinkphp/library/think/
TRAIT_PATH
/home/acgroot/s02/thinkphp/library/traits/
ROOT_PATH
/home/acgroot/s02/
EXTEND_PATH
/home/acgroot/s02/extend/
VENDOR_PATH
/home/acgroot/s02/vendor/
RUNTIME_PATH
/home/acgroot/s02/runtime/
LOG_PATH
/home/acgroot/s02/runtime/log/
CACHE_PATH
/home/acgroot/s02/runtime/cache/
TEMP_PATH
/home/acgroot/s02/runtime/temp/
CONF_PATH
/home/acgroot/s02/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
ADDON_PATH
/home/acgroot/s02/addons/