[8] ErrorException in ArticleService.php line 502

Trying to get property 'id' of non-object

  1. * @return false|\PDOStatement|string|\think\Collection
  2. */
  3. public function getCategoryChildrenChildName($parentCategory)
  4. {
  5. $model = new model\PortalCategoryModel();
  6. $parent_id = $model->where('name', $parentCategory)->where('status', 1)->find()->id;
  7. $childrenCategory = $model->where('parent_id', $parent_id)->where('delete_time', 0)->where('status', 1)->field('name,list_order')->order('list_order')->select();
  8. return $childrenCategory;
  9. }
  10. /*获取一级分类下所有分类的产品*/

Call Stack

  1. in ArticleService.php line 502
  2. at Error::appError(8, 'Trying to get proper...', '/home/wwwroot/www.sc...', 502, ['parentCategory' => '...', 'model' => object(PortalCategoryModel)]) in ArticleService.php line 502
  3. at ArticleService->getCategoryChildrenChildName('...') in IndexController.php line 307
  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
随车起重运输车
child_category
折臂吊
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=%E9%9A%8F%E8%BD%A6%E8%B5%B7%E9%87%8D%E8%BF%90%E8%BE%93%E8%BD%A6&child_category=%E6%8A%98%E8%87%82%E5%90%8A
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
39178
REMOTE_ADDR
3.238.84.213
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=%E9%9A%8F%E8%BD%A6%E8%B5%B7%E9%87%8D%E8%BF%90%E8%BE%93%E8%BD%A6&child_category=%E6%8A%98%E8%87%82%E5%90%8A
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=hx/index/all_product.html&category=%E9%9A%8F%E8%BD%A6%E8%B5%B7%E9%87%8D%E8%BF%90%E8%BE%93%E8%BD%A6&child_category=%E6%8A%98%E8%87%82%E5%90%8A
SCRIPT_FILENAME
/home/wwwroot/www.schxmy.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711708511.943
REQUEST_TIME
1711708511
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
1711708511.9436
THINK_START_MEM
411784
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