[8] ErrorException in common.php line 12

Trying to get property 'user_nickname' of non-object

  1. use app\portal\model\OrderModel;
  2. use app\portal\model\PortalPostModel;
  3. use GuzzleHttp\Client;
  4. function getNickNameByUid($userId)
  5. {
  6. $key = __FUNCTION__ . md5(serialize(func_get_args())) . 'v3';
  7. return \think\facade\Cache::remember($key, function () use ($userId) {
  8. $user = \api\user\model\UserModel::find($userId);
  9. return $user->user_nickname ?: '起点海绵';
  10. }, 86400);
  11. }
  12. function getUser($userId)
  13. {
  14. $key = __FUNCTION__ . md5(serialize(func_get_args())) . 'v3';
  15. return \think\facade\Cache::remember($key, function () use ($userId) {
  16. return \api\user\model\UserModel::find($userId);

Call Stack

  1. in common.php line 12
  2. at Error::appError(8, 'Trying to get proper...', '/www/wwwroot/921i.co...', 12, ['userId' => 11, 'user' => null]) in common.php line 12
  3. at {closure}()
  4. at call_user_func_array(object(Closure), []) in Container.php line 347
  5. at Container->invokeFunction(object(Closure)) in Driver.php line 185
  6. at Driver->remember('getNickNameByUida33b...', object(Closure), 86400)
  7. at call_user_func_array([object(File), 'remember'], ['getNickNameByUida33b...', object(Closure), 86400]) in Cache.php line 130
  8. at Cache->__call('remember', ['getNickNameByUida33b...', object(Closure), 86400])
  9. at call_user_func_array([object(Cache), 'remember'], ['getNickNameByUida33b...', object(Closure), 86400]) in Facade.php line 123
  10. at Facade::__callStatic('remember', ['getNickNameByUida33b...', object(Closure), 86400]) in common.php line 13
  11. at getNickNameByUid(11) in e6d6890eb30533f492333e864b5ddad9.php line 112
  12. at include('/www/wwwroot/921i.co...') in File.php line 59
  13. at File->read('/www/wwwroot/921i.co...', ['site_info' => ['site_name' => '起点起名网', 'site_seo_title' => '...', 'site_seo_keywords' => '起名,取名,免费...', ...], 'nameTags' => [['快乐', '爱国', '英俊', ...], ['善良', '优雅', '爱国', ...], ['优雅', '爱国', '吉祥', ...]], 'bjx2' => ['李', '利', '付', ...], ...]) in Template.php line 226
  14. at Template->fetch('/www/wwwroot/921i.co...', ['site_info' => ['site_name' => '起点起名网', 'site_seo_title' => '...', 'site_seo_keywords' => '起名,取名,免费...', ...], 'nameTags' => [['快乐', '爱国', '英俊', ...], ['善良', '优雅', '爱国', ...], ['优雅', '爱国', '吉祥', ...]], 'bjx2' => ['李', '利', '付', ...], ...], []) in Think.php line 93
  15. at Think->fetch('/www/wwwroot/921i.co...', ['site_info' => ['site_name' => '起点起名网', 'site_seo_title' => '...', 'site_seo_keywords' => '起名,取名,免费...', ...], 'nameTags' => [['快乐', '爱国', '英俊', ...], ['善良', '优雅', '爱国', ...], ['优雅', '爱国', '吉祥', ...]], 'bjx2' => ['李', '利', '付', ...], ...], []) in View.php line 192
  16. at View->fetch('/www/wwwroot/921i.co...', ['site_info' => ['site_name' => '起点起名网', 'site_seo_title' => '...', 'site_seo_keywords' => '起名,取名,免费...', ...], 'nameTags' => [['快乐', '爱国', '英俊', ...], ['善良', '优雅', '爱国', ...], ['优雅', '爱国', '吉祥', ...]], 'bjx2' => ['李', '利', '付', ...], ...], []) in HomeBaseController.php line 86
  17. at HomeBaseController->fetch('/www/wwwroot/921i.co...') in ArticleController.php line 144
  18. at ArticleController->index()
  19. at ReflectionMethod->invokeArgs(object(ArticleController), []) in Container.php line 395
  20. at Container->invokeReflectMethod(object(ArticleController), object(ReflectionMethod), ['cid' => '12', 'id' => '33', 'convert' => false]) in Module.php line 131
  21. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  22. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  23. at Middleware->think\{closure}(object(Request))
  24. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  25. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  26. at Module->exec() in Dispatch.php line 168
  27. at Dispatch->run() in App.php line 484
  28. at App->think\{closure}(object(Request), object(Closure), null)
  29. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  30. at Middleware->think\{closure}(object(Request))
  31. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  32. at Middleware->dispatch(object(Request)) in App.php line 487
  33. at App->run() in index.php line 38

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST www.921i.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.921i.com
SERVER_PORT 443
SERVER_ADDR 10.0.0.130
REMOTE_PORT 50702
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 /www/wwwroot/921i.com/public
DOCUMENT_URI /index.php
REQUEST_URI /nvhaiqiming/33.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/nvhaiqiming/33.html
SCRIPT_FILENAME /www/wwwroot/921i.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711633523.0639
REQUEST_TIME 1711633523
Environment Variablesempty
ThinkPHP Constants
APP_STORE_CHECK false
APP_CHECK_WX_MP_VERSION_CODE 0
APP_CHECK_VERSION_CODE 0
SHOW_WECHAT true
APP_DEBUG 1
CMF_ROOT /www/wwwroot/921i.com/
CMF_DATA /www/wwwroot/921i.com/data/
APP_PATH /www/wwwroot/921i.com/app/
WEB_ROOT /www/wwwroot/921i.com/public/
SHENGXIAO_ARR [ "\u7334", "\u9e21", "\u72d7", "\u732a", "\u9f20", "\u725b", "\u864e", "\u5154", "\u9f99", "\u86c7", "\u9a6c", "\u7f8a" ]
SEX_BOY 1
SEX_GIRL 2
SEX_UNKNOWN 3
MINGZI_DAQUAN_CID 7
QIMING_CID 1
BOY_QIMING_CID 11
GIRL_QIMING_CID 12
ZHOUYIBAZI_QIMING_CID 13
SHIJING_QIMING_CID 14
TANGSHI_QIMING_CID 15
ZHUANJIA_QIMING_CID 2
CEMING_DAFEN_CID 3
GONGSI_QIMING_CID 4
SHENGXIAO_QIMING_CID 16
DIANPU_QIMING_CID 5
YINGWEN_QIMING_CID 6
WANGMING_QIMING_CID 8
YOUXI_QIMING_CID 9
XIAOMING_QIMING_CID 31
CHONGWU_QIMING_CID 31
DEVICE_ANDROID android
DEVICE_IPHONE iphone
DEVICE_IPAD ipad
BROWSER_WECHAT_SMART 1
BROWSER_BAIDU_SMART 2
BROWSER_ORIGIN 3
BROWSER_WECHAT 4
BROWSER_PC 5
FILTER_VALIDATE_BOOL 258
HTMLPURIFIER_PREFIX /www/wwwroot/921i.com/vendor/ezyang/htmlpurifier/library
0.148752s