[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=%E4%B8%93%E7%94%A8%E6%B1%BD%E8%BD%A6&child_category=%E6%B7%B7%E5%87%9D%E5%9C%9F%E6%90%85%E6%8B%8C%E8%BF%90%E8%BE%93%E8%BD%A6
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
36018
REMOTE_ADDR
34.203.242.200
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=%E4%B8%93%E7%94%A8%E6%B1%BD%E8%BD%A6&child_category=%E6%B7%B7%E5%87%9D%E5%9C%9F%E6%90%85%E6%8B%8C%E8%BF%90%E8%BE%93%E8%BD%A6
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=hx/index/all_product.html&category=%E4%B8%93%E7%94%A8%E6%B1%BD%E8%BD%A6&child_category=%E6%B7%B7%E5%87%9D%E5%9C%9F%E6%90%85%E6%8B%8C%E8%BF%90%E8%BE%93%E8%BD%A6
SCRIPT_FILENAME
/home/wwwroot/www.schxmy.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711635597.5461
REQUEST_TIME
1711635597
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
1711635597.547
THINK_START_MEM
411800
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