[8] ErrorException in ArticleService.php line 612

Trying to get property 'id' of non-object

  1. public function getCategoryAllProduct($categoryName, $perPageNumber)
  2. {
  3. $model = new model\PortalCategoryModel();
  4. $c_id = $model->where('name', $categoryName)->where('status', 1)->find();
  5. $child_id = $model->where('parent_id', $c_id->id)->field('id')->select()->toArray();
  6. $tmp = '';
  7. foreach ($child_id as $k => $v) {
  8. $tmp = $tmp . $v['id'] . ',';
  9. }

Call Stack

  1. in ArticleService.php line 612
  2. at Error::appError(8, 'Trying to get proper...', '/home/wwwroot/www.sc...', 612, ['categoryName' => '%E9%9A%8F%E8%BD%A6%E...', 'perPageNumber' => 9, 'model' => object(PortalCategoryModel), ...]) in ArticleService.php line 612
  3. at ArticleService->getCategoryAllProduct('%E9%9A%8F%E8%BD%A6%E...', 9) in IndexController.php line 293
  4. at IndexController->all_product()
  5. at ReflectionMethod->invokeArgs(object(IndexController), []) in App.php line 343
  6. at App::invokeMethod([object(IndexController), 'all_product'], []) in App.php line 611
  7. at App::module(['hx', 'index', 'all_product'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 456
  8. at App::exec(['type' => 'module', 'module' => ['hx', 'index', 'all_product']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  9. at App::run() in index.php line 41

Environment Variables

GET Data

category
%E9%9A%8F%E8%BD%A6%E8%B5%B7%E9%87%8D%E8%BF%90%E8%BE%93%E8%BD%A6
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_REFERER
http://www.schxmy.com/hx/index/all_product.html?category=%25E9%259A%258F%25E8%25BD%25A6%25E8%25B5%25B7%25E9%2587%258D%25E8%25BF%2590%25E8%25BE%2593%25E8%25BD%25A6
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_HOST
www.schxmy.com
PATH_INFO
hx/index/all_product.html
REDIRECT_STATUS
200
SERVER_NAME
www.schxmy.com
SERVER_PORT
443
SERVER_ADDR
211.149.136.81
REMOTE_PORT
34412
REMOTE_ADDR
54.243.2.41
SERVER_SOFTWARE
nginx/1.22.1
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/2.0
DOCUMENT_ROOT
/home/wwwroot/www.schxmy.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/hx/index/all_product.html?category=%25E9%259A%258F%25E8%25BD%25A6%25E8%25B5%25B7%25E9%2587%258D%25E8%25BF%2590%25E8%25BE%2593%25E8%25BD%25A6
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=hx/index/all_product.html&category=%25E9%259A%258F%25E8%25BD%25A6%25E8%25B5%25B7%25E9%2587%258D%25E8%25BF%2590%25E8%25BE%2593%25E8%25BD%25A6
SCRIPT_FILENAME
/home/wwwroot/www.schxmy.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711627394.9456
REQUEST_TIME
1711627394
Environment Variables
empty

ThinkPHP Constants

APP_DEBUG
false
CMF_ROOT
/home/wwwroot/www.schxmy.com/public/../
APP_PATH
/home/wwwroot/www.schxmy.com/public/../app/
CMF_PATH
/home/wwwroot/www.schxmy.com/public/../simplewind/cmf/
PLUGINS_PATH
/home/wwwroot/www.schxmy.com/public/plugins/
EXTEND_PATH
/home/wwwroot/www.schxmy.com/public/../simplewind/extend/
VENDOR_PATH
/home/wwwroot/www.schxmy.com/public/../simplewind/vendor/
RUNTIME_PATH
/home/wwwroot/www.schxmy.com/public/../data/runtime/
THINKCMF_VERSION
5.0.180901
THINK_VERSION
5.0.24
THINK_START_TIME
1711627394.9462
THINK_START_MEM
411760
EXT
.php
DS
/
THINK_PATH
/home/wwwroot/www.schxmy.com/simplewind/thinkphp/
LIB_PATH
/home/wwwroot/www.schxmy.com/simplewind/thinkphp/library/
CORE_PATH
/home/wwwroot/www.schxmy.com/simplewind/thinkphp/library/think/
TRAIT_PATH
/home/wwwroot/www.schxmy.com/simplewind/thinkphp/library/traits/
ROOT_PATH
/home/wwwroot/www.schxmy.com/
LOG_PATH
/home/wwwroot/www.schxmy.com/public/../data/runtime/log/
CACHE_PATH
/home/wwwroot/www.schxmy.com/public/../data/runtime/cache/
TEMP_PATH
/home/wwwroot/www.schxmy.com/public/../data/runtime/temp/
CONF_PATH
/home/wwwroot/www.schxmy.com/public/../app/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
HTMLPURIFIER_PREFIX
/home/wwwroot/www.schxmy.com/simplewind/vendor/ezyang/htmlpurifier/library
QINIU_FUNCTIONS_VERSION
7.2.5